]> git.proxmox.com Git - mirror_zfs.git/commit
Verify embedded blkptr's in arc_read()
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 10 Sep 2021 01:02:07 +0000 (18:02 -0700)
committerGitHub <noreply@github.com>
Fri, 10 Sep 2021 01:02:07 +0000 (19:02 -0600)
commitb9ec4a15e5ab40e6c32dd445ecebcd3a3fed1ef9
tree6c1f1a80a67ad6714876b49aebe58c6d4b1a83d2
parent5a54a4e0517959dd917c0f78d692f7364e597a68
Verify embedded blkptr's in arc_read()

The block pointer verification check in arc_read() should also
cover embedded block pointers.  While highly unlikely, accessing
a damaged block pointer can result in panic.  To further harden
the code extend the existing check to include embedded block
pointers and add a comment explaining the rational for this
sanity check.  Lastly, correct a flaw in zfs_blkptr_verify()
so the error count is checked even when checking a untrusted
config to verify the non-pool-specific portions of a block
pointer.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #12535
module/zfs/arc.c
module/zfs/zio.c