Skip to content

Commit fe67499

Browse files
authored
Check portable objset MAC even if local is zeroed
PR #14161 made spa_do_crypt_objset_mac_abd() to ignore MAC errors if local MAC can not be calculated at the time. But it does not mean we should also ignore portable MAC errors there. Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc. Closes #17122
1 parent 57f192f commit fe67499

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

module/zfs/dsl_crypt.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2738,8 +2738,11 @@ spa_do_crypt_objset_mac_abd(boolean_t generate, spa_t *spa, uint64_t dsobj,
27382738
}
27392739

27402740
if (memcmp(portable_mac, osp->os_portable_mac,
2741-
ZIO_OBJSET_MAC_LEN) != 0 ||
2742-
memcmp(local_mac, osp->os_local_mac, ZIO_OBJSET_MAC_LEN) != 0) {
2741+
ZIO_OBJSET_MAC_LEN) != 0) {
2742+
abd_return_buf(abd, buf, datalen);
2743+
return (SET_ERROR(ECKSUM));
2744+
}
2745+
if (memcmp(local_mac, osp->os_local_mac, ZIO_OBJSET_MAC_LEN) != 0) {
27432746
/*
27442747
* If the MAC is zeroed out, we failed to decrypt it.
27452748
* This should only arise, at least on Linux,

0 commit comments

Comments
 (0)