-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Verify embedded blkptr's in arc_read() #12535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cc: @tcaputi would you mind reviewing this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine. However, I took a look at zfs_blkptr_verify() and I don't understand this code:
* Do not verify individual DVAs if the config is not trusted. This
* will be done once the zio is executed in vdev_mirror_map_alloc.
*/
if (!spa->spa_trust_config)
return (B_TRUE);
Shouldn't it be returning errors == 0
, so that we are checking the non-pool-specific parts of the BP?
8a0d3eb
to
dcb7ed6
Compare
Good catch. Yes, it looks like this case was missed when commit bc67cba updated |
dcb7ed6
to
f273b75
Compare
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. Signed-off-by: Brian Behlendorf <[email protected]>
f273b75
to
a9d9a26
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
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 <[email protected]> Reviewed-by: Tony Nguyen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes openzfs#12535
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 <[email protected]> Reviewed-by: Tony Nguyen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes openzfs#12535
Motivation and Context
When attempting to recover a pool it was determined that it
somehow contained at least one damaged embedded block
pointer. Since this blkptr was always accessed during import
it effectively prevented the pool from being imported. By
detecting the damaged embedded block pointer and treating
it as a normal checksum error it was possible to import and
recover the pool.
Description
The block pointer verification check in
arc_read()
should alsocover 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.
How Has This Been Tested?
Used to recover a pool which contained a damaged blkptr which
was protected by a valid checksum.
Types of changes
Checklist:
Signed-off-by
.