-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
RFC: Don't panic on unencrypted block in encrypted dataset. #15677
Conversation
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.
While formally it is a pool corruption and should not happen, I agree that it makes no sense to crash the system on it. As these are reads, the errors there should be handled clean and unlike some space map corruptions, for example, should not cause more problems if system is not crashed. May be we could leave some ASSERT() there to ease the debugging of debug builds, but we should not panic production boxes on this.
Looking through the other zfs_panic_recover() use cases I see couple more questionable ones. I wonder if we should introduce some printf()-like variation of ASSERT() to report arbitrary panic messages on debug builds, or just use PANIC() wrapped in ZFS_DEBUG.
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.
Agreed we should gracefully handle these by default. Can you just address the two style warnings and force update the PR. You can run make checkstyle
locally to make sure it's happy.
error: commit subject over 72 characters
error: missing "Signed-off-by"
error: commit message body contains line over 72 characters
3ba91d6
to
2839199
Compare
While 763ca47 closes the situation of block cloning creating unencrypted records in encrypted datasets, existing data still causes panic on read. Setting zfs_recover bypasses this but at the cost of potentially ignoring more serious issues. Signed-off-by: Chris Peredun <[email protected]>
2839199
to
72012ed
Compare
Style warnings addressed, thank you. |
While 763ca47 closes the situation of block cloning creating unencrypted records in encrypted datasets, existing data still causes panic on read. Setting zfs_recover bypasses this but at the cost of potentially ignoring more serious issues. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Chris Peredun <[email protected]> Closes openzfs#15677
While 763ca47 closes the situation of block cloning creating unencrypted records in encrypted datasets, existing data still causes panic on read. Setting zfs_recover bypasses this but at the cost of potentially ignoring more serious issues. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Chris Peredun <[email protected]> Closes openzfs#15677
While 763ca47 closes the situation of block cloning creating unencrypted records in encrypted datasets, existing data still causes panic on read. Setting zfs_recover bypasses this but at the cost of potentially ignoring more serious issues. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Chris Peredun <[email protected]> Closes openzfs#15677
While 763ca47 closes the situation of block cloning creating unencrypted records in encrypted datasets, existing data still causes panic on read. Setting zfs_recover bypasses this but at the cost of potentially ignoring more serious issues. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Chris Peredun <[email protected]> Closes openzfs#15677
While 763ca47 closes the situation of block cloning creating unencrypted records in encrypted datasets, existing data still causes panic on read. Setting zfs_recover bypasses this but at the cost of potentially ignoring more serious issues. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Chris Peredun <[email protected]> Closes #15677
While 763ca47 closes the situation of block cloning creating unencrypted records in encrypted datasets, existing data still causes panic on read. Setting zfs_recover bypasses this but at the cost of potentially ignoring more serious issues. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Chris Peredun <[email protected]> Closes openzfs#15677
While 763ca47 closes the situation of block cloning creating unencrypted records in encrypted datasets, existing data still causes panic on read. Setting zfs_recover bypasses this but at the cost of potentially ignoring more serious issues. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Chris Peredun <[email protected]> Closes openzfs#15677
Motivation and Context
While #15465 closes the situation of block cloning creating unencrypted records in encrypted datasets, any existing data that was cloned prior to this still causes panic on read. Setting
zfs_recover=1
bypasses the panic but is a bit of a blunt instrument as it avoids all panics.Since the code paths here already call
spa_log_error
and returnEIO
for the read, the actual unencrypted data shouldn't ever be sent upstream, so this shouldn't introduce a vulnerable scenario where deliberately injected data would be returned. We can perhaps be louder about the alert, but this at least prevents users from having accidentally populated an encrypted dataset with files that could crash their system.Description
Removed the call to
zfs_panic_recover
at dbuf.c#L1637 and dmu_send.c#L1127How Has This Been Tested?
Copied a test file from unencrypted to encrypted dataset using
cp
, confirmed that reading withdd
results in a crash, made change, repeated process and received no crash on read, with application receiving an I/O error.Types of changes
Checklist:
Signed-off-by
.