mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 19:57:43 +03:00
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
This commit is contained in:
+1
-1
@@ -1006,7 +1006,7 @@ zfs_blkptr_verify(spa_t *spa, const blkptr_t *bp, boolean_t config_held,
|
||||
* will be done once the zio is executed in vdev_mirror_map_alloc.
|
||||
*/
|
||||
if (!spa->spa_trust_config)
|
||||
return (B_TRUE);
|
||||
return (errors == 0);
|
||||
|
||||
if (!config_held)
|
||||
spa_config_enter(spa, SCL_VDEV, bp, RW_READER);
|
||||
|
||||
Reference in New Issue
Block a user