mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +03:00
Raw receive fix and encrypted objset security fix
This patch fixes two problems with the encryption code. First, the current code does not correctly prohibit the DMU from updating dn_maxblkid during object truncation within a raw receive. This usually only causes issues when the truncating DRR_FREE record is aggregated with DRR_FREE records later in the receive, so it is relatively hard to hit. Second, this patch fixes a security issue where reading blocks within an encrypted object did not guarantee that the dnode block itself had ever been verified against its MAC. Usually the verification happened anyway when the bonus buffer was read, but some use cases (notably zvols) might never perform the check. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Signed-off-by: Tom Caputi <tcaputi@datto.com> Closes #7632
This commit is contained in:
committed by
Brian Behlendorf
parent
3be1eb29da
commit
69830602de
+7
-3
@@ -2137,13 +2137,17 @@ arc_buf_fill(arc_buf_t *buf, spa_t *spa, const zbookmark_phys_t *zb,
|
||||
}
|
||||
|
||||
/*
|
||||
* Adjust encrypted and authenticated headers to accomodate the
|
||||
* request if needed.
|
||||
* Adjust encrypted and authenticated headers to accomodate
|
||||
* the request if needed. Dnode blocks (ARC_FILL_IN_PLACE) are
|
||||
* allowed to fail decryption due to keys not being loaded
|
||||
* without being marked as an IO error.
|
||||
*/
|
||||
if (HDR_PROTECTED(hdr)) {
|
||||
error = arc_fill_hdr_crypt(hdr, hash_lock, spa,
|
||||
zb, !!(flags & ARC_FILL_NOAUTH));
|
||||
if (error != 0) {
|
||||
if (error == EACCES && (flags & ARC_FILL_IN_PLACE) != 0) {
|
||||
return (error);
|
||||
} else if (error != 0) {
|
||||
if (hash_lock != NULL)
|
||||
mutex_enter(hash_lock);
|
||||
arc_hdr_set_flags(hdr, ARC_FLAG_IO_ERROR);
|
||||
|
||||
Reference in New Issue
Block a user