HomeFreeBSD

Receive checks should allow unencrypted child datasets

Description

Receive checks should allow unencrypted child datasets

dmu_recv_begin_check() unconditionally sets the DS_HOLD_FLAG_DECRYPT
flag before calling dsl_dataset_hold_flags(). If the key on the
receiving side isn't loaded or the send stream contains embedded
blocks, the receive check fails for a stream which is perfectly
valid and could be received without any problem. This seems like
a remnant of the initial design, where unencrypted datasets below
encrypted ones weren't allowed.

Add a condition to set DS_HOLD_FLAG_DECRYPT only for encrypted
datasets, modify an existing test to detect this regression and add
a test for raw replication streams.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Amanakis <gamanakis@gmail.com>
Co-authored-by: George Amanakis <gamanakis@gmail.com>
Signed-off-by: Attila Fülöp <attila@fueloep.org>
Closes #13033
Closes #13076

Details

Provenance
Attila Fülöp <attila@fueloep.org>Authored on Feb 9 2022, 10:38 PM
Tony Hutter <hutter2@llnl.gov>Committed on Feb 17 2022, 1:58 AM
Parents
rG2681f8a5b858: Propagate KERNEL_* to *.spec
Branches
Unknown
Tags
Unknown

Event Timeline

Tony Hutter <hutter2@llnl.gov> committed rG5c19af07d4df: Receive checks should allow unencrypted child datasets (authored by Attila Fülöp <attila@fueloep.org>).Feb 17 2022, 1:58 AM