mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Native Encryption for ZFS on Linux
This change incorporates three major pieces: The first change is a keystore that manages wrapping and encryption keys for encrypted datasets. These commands mostly involve manipulating the new DSL Crypto Key ZAP Objects that live in the MOS. Each encrypted dataset has its own DSL Crypto Key that is protected with a user's key. This level of indirection allows users to change their keys without re-encrypting their entire datasets. The change implements the new subcommands "zfs load-key", "zfs unload-key" and "zfs change-key" which allow the user to manage their encryption keys and settings. In addition, several new flags and properties have been added to allow dataset creation and to make mounting and unmounting more convenient. The second piece of this patch provides the ability to encrypt, decyrpt, and authenticate protected datasets. Each object set maintains a Merkel tree of Message Authentication Codes that protect the lower layers, similarly to how checksums are maintained. This part impacts the zio layer, which handles the actual encryption and generation of MACs, as well as the ARC and DMU, which need to be able to handle encrypted buffers and protected data. The last addition is the ability to do raw, encrypted sends and receives. The idea here is to send raw encrypted and compressed data and receive it exactly as is on a backup system. This means that the dataset on the receiving system is protected using the same user key that is in use on the sending side. By doing so, datasets can be efficiently backed up to an untrusted system without fear of data being compromised. Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Jorgen Lundman <lundman@lundman.net> Signed-off-by: Tom Caputi <tcaputi@datto.com> Closes #494 Closes #5769
This commit is contained in:
committed by
Brian Behlendorf
parent
376994828f
commit
b525630342
@@ -171,6 +171,14 @@ typedef enum {
|
||||
ZFS_PROP_OVERLAY,
|
||||
ZFS_PROP_PREV_SNAP,
|
||||
ZFS_PROP_RECEIVE_RESUME_TOKEN,
|
||||
ZFS_PROP_ENCRYPTION,
|
||||
ZFS_PROP_KEYLOCATION,
|
||||
ZFS_PROP_KEYFORMAT,
|
||||
ZFS_PROP_PBKDF2_SALT,
|
||||
ZFS_PROP_PBKDF2_ITERS,
|
||||
ZFS_PROP_ENCRYPTION_ROOT,
|
||||
ZFS_PROP_KEY_GUID,
|
||||
ZFS_PROP_KEYSTATUS,
|
||||
ZFS_NUM_PROPS
|
||||
} zfs_prop_t;
|
||||
|
||||
@@ -281,6 +289,8 @@ uint64_t zfs_prop_default_numeric(zfs_prop_t);
|
||||
boolean_t zfs_prop_readonly(zfs_prop_t);
|
||||
boolean_t zfs_prop_inheritable(zfs_prop_t);
|
||||
boolean_t zfs_prop_setonce(zfs_prop_t);
|
||||
boolean_t zfs_prop_encryption_key_param(zfs_prop_t);
|
||||
boolean_t zfs_prop_valid_keylocation(const char *, boolean_t);
|
||||
const char *zfs_prop_to_name(zfs_prop_t);
|
||||
zfs_prop_t zfs_name_to_prop(const char *);
|
||||
boolean_t zfs_prop_user(const char *);
|
||||
@@ -404,6 +414,30 @@ typedef enum {
|
||||
ZFS_VOLMODE_NONE = 3
|
||||
} zfs_volmode_t;
|
||||
|
||||
typedef enum zfs_keystatus {
|
||||
ZFS_KEYSTATUS_NONE = 0,
|
||||
ZFS_KEYSTATUS_UNAVAILABLE,
|
||||
ZFS_KEYSTATUS_AVAILABLE,
|
||||
} zfs_keystatus_t;
|
||||
|
||||
typedef enum zfs_keyformat {
|
||||
ZFS_KEYFORMAT_NONE = 0,
|
||||
ZFS_KEYFORMAT_RAW,
|
||||
ZFS_KEYFORMAT_HEX,
|
||||
ZFS_KEYFORMAT_PASSPHRASE,
|
||||
ZFS_KEYFORMAT_FORMATS
|
||||
} zfs_keyformat_t;
|
||||
|
||||
typedef enum zfs_key_location {
|
||||
ZFS_KEYLOCATION_NONE = 0,
|
||||
ZFS_KEYLOCATION_PROMPT,
|
||||
ZFS_KEYLOCATION_URI,
|
||||
ZFS_KEYLOCATION_LOCATIONS
|
||||
} zfs_keylocation_t;
|
||||
|
||||
#define DEFAULT_PBKDF2_ITERATIONS 350000
|
||||
#define MIN_PBKDF2_ITERATIONS 100000
|
||||
|
||||
/*
|
||||
* On-disk version number.
|
||||
*/
|
||||
@@ -1061,6 +1095,9 @@ typedef enum zfs_ioc {
|
||||
ZFS_IOC_DESTROY_BOOKMARKS,
|
||||
ZFS_IOC_RECV_NEW,
|
||||
ZFS_IOC_POOL_SYNC,
|
||||
ZFS_IOC_LOAD_KEY,
|
||||
ZFS_IOC_UNLOAD_KEY,
|
||||
ZFS_IOC_CHANGE_KEY,
|
||||
|
||||
/*
|
||||
* Linux - 3/64 numbers reserved.
|
||||
@@ -1125,6 +1162,12 @@ typedef enum {
|
||||
#define ZPOOL_HIST_DSNAME "dsname"
|
||||
#define ZPOOL_HIST_DSID "dsid"
|
||||
|
||||
/*
|
||||
* Special nvlist name that will not have its args recorded in the pool's
|
||||
* history log.
|
||||
*/
|
||||
#define ZPOOL_HIDDEN_ARGS "hidden_args"
|
||||
|
||||
/*
|
||||
* Flags for ZFS_IOC_VDEV_SET_STATE
|
||||
*/
|
||||
@@ -1144,6 +1187,7 @@ typedef enum {
|
||||
#define ZFS_IMPORT_ONLY 0x8
|
||||
#define ZFS_IMPORT_TEMP_NAME 0x10
|
||||
#define ZFS_IMPORT_SKIP_MMP 0x20
|
||||
#define ZFS_IMPORT_LOAD_KEYS 0x40
|
||||
|
||||
/*
|
||||
* Sysevent payload members. ZFS will generate the following sysevents with the
|
||||
|
||||
Reference in New Issue
Block a user