diff options
author | Tom Caputi <[email protected]> | 2019-02-04 14:24:55 -0500 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-03-13 11:00:43 -0700 |
commit | f00ab3f22cc2c7f62cfd56be842945667b1d558f (patch) | |
tree | 1982f7f27afc2209153f79fa3d43cf5706183a9f /cmd/zpool/zpool_main.c | |
parent | 579ce7c5ae65e670496d41957f63352cb3f0d298 (diff) |
Detect and prevent mixed raw and non-raw sends
Currently, there is an issue in the raw receive code where
raw receives are allowed to happen on top of previously
non-raw received datasets. This is a problem because the
source-side dataset doesn't know about how the blocks on
the destination were encrypted. As a result, any MAC in
the objset's checksum-of-MACs tree that is a parent of both
blocks encrypted on the source and blocks encrypted by the
destination will be incorrect. This will result in
authentication errors when we decrypt the dataset.
This patch fixes this issue by adding a new check to the
raw receive code. The code now maintains an "IVset guid",
which acts as an identifier for the set of IVs used to
encrypt a given snapshot. When a snapshot is raw received,
the destination snapshot will take this value from the
DRR_BEGIN payload. Non-raw receives and normal "zfs snap"
operations will cause ZFS to generate a new IVset guid.
When a raw incremental stream is received, ZFS will check
that the "from" IVset guid in the stream matches that of
the "from" destination snapshot. If they do not match, the
code will error out the receive, preventing the problem.
This patch requires an on-disk format change to add the
IVset guids to snapshots and bookmarks. As a result, this
patch has errata handling and a tunable to help affected
users resolve the issue with as little interruption as
possible.
Reviewed-by: Paul Dagnelie <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Matt Ahrens <[email protected]>
Signed-off-by: Tom Caputi <[email protected]>
Closes #8308
Diffstat (limited to 'cmd/zpool/zpool_main.c')
-rw-r--r-- | cmd/zpool/zpool_main.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index 68723a0e2..c36003c98 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -2478,6 +2478,17 @@ show_import(nvlist_t *config) "old ones.\n")); break; + case ZPOOL_ERRATA_ZOL_8308_ENCRYPTION: + (void) printf(gettext(" action: Existing " + "encrypted datasets contain an on-disk " + "incompatibility which\n\tmay cause " + "on-disk corruption with 'zfs recv' and " + "which needs to be\n\tcorrected. Enable " + "the bookmark_v2 feature and backup " + "these datasets to new encrypted " + "datasets and\n\tdestroy the " + "old ones.\n")); + break; default: /* * All errata must contain an action message. @@ -7401,6 +7412,17 @@ status_callback(zpool_handle_t *zhp, void *data) "mount existing encrypted datasets readonly.\n")); break; + case ZPOOL_ERRATA_ZOL_8308_ENCRYPTION: + (void) printf(gettext("\tExisting encrypted datasets " + "contain an on-disk incompatibility\n\twhich " + "needs to be corrected.\n")); + (void) printf(gettext("action: To correct the issue " + "enable the bookmark_v2 feature and " + "backup\n\texisting encrypted datasets to new " + "encrypted datasets and\n\tdestroy the old " + "ones.\n")); + break; + default: /* * All errata which allow the pool to be imported |