]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
zfskeys: Support autoloading of keys stored on ZFS
authorMateusz Piotrowski <0mp@FreeBSD.org>
Fri, 18 Mar 2022 12:35:16 +0000 (13:35 +0100)
committerMateusz Piotrowski <0mp@FreeBSD.org>
Mon, 21 Mar 2022 14:47:20 +0000 (15:47 +0100)
commit2411090f69401998569f24144b08ffc050e3cebc
tree41323b40261e8c20f64c517765a6dbce407e0004
parent476b3bb0916d7ada163040b3b3f523e92d608733
zfskeys: Support autoloading of keys stored on ZFS

The zfskeys service script starts before the zfs service script, so that
dataset decryption keys are available when `zfs mount -a` is run. One of
the potential edge cases of this design is that if a key is stored on
ZFS it won't be loaded until `zfs mount -a` is issued.

In order to address that let's try to load the additional keys and mount
related ZFS datasets after the zfs script finishes its standard mounting
procedure.

PR: 262468
Reported by: Graham Perrin <grahamperrin@gmail.com>
Reviewed by: allanjude
Approved by: allanjude (src)
Fixes: 33ff39796ffe Add zfskeys rc.d script for auto-loading encryption keys
MFC after: 3 days
Sponsored by: Modirum
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D34601

(cherry picked from commit 97aeda2243568b386d792514996a06daec55eece)
libexec/rc/rc.d/zfs