zfs/module
Tom Caputi f00ab3f22c 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 <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #8308
2019-03-13 11:00:43 -07:00
..
avl Update build system and packaging 2018-05-29 16:00:33 -07:00
icp Fedora 28: Fix misc bounds check compiler warnings 2018-08-26 12:55:44 -07:00
lua Update build system and packaging 2018-05-29 16:00:33 -07:00
nvpair Add new fnvlist_lookup_* functions 2018-10-03 15:30:55 -07:00
spl Linux 5.1 compat: get_ds() removed 2019-03-07 14:44:23 -08:00
unicode Update build system and packaging 2018-05-29 16:00:33 -07:00
zcommon Detect and prevent mixed raw and non-raw sends 2019-03-13 11:00:43 -07:00
zfs Detect and prevent mixed raw and non-raw sends 2019-03-13 11:00:43 -07:00
.gitignore Prepare SPL repo to merge with ZFS repo 2018-05-29 14:51:39 -07:00
Makefile.in Linux 5.0 compat: Fix SUBDIRs 2019-01-28 10:11:45 -08:00