-
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
abd_get_offset_struct() may allocate new abd #11683
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Even when supplied with an abd to abd_get_offset_struct(), the call to abd_get_offset_impl() can allocate a different abd. Ensure to call abd_fini_struct() on the abd that is not used. Signed-off-by: Jorgen Lundman <[email protected]>
behlendorf
approved these changes
Mar 3, 2021
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. Seems like this issue could be a problem for all the platforms to varying degrees.
ahrens
approved these changes
Mar 3, 2021
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.
Thanks for catching this!
behlendorf
added
Status: Accepted
Ready to integrate (reviewed, tested)
and removed
Status: Code Review Needed
Ready for review and testing
labels
Mar 3, 2021
jsai20
pushed a commit
to jsai20/zfs
that referenced
this pull request
Mar 30, 2021
Even when supplied with an abd to abd_get_offset_struct(), the call to abd_get_offset_impl() can allocate a different abd. Ensure to call abd_fini_struct() on the abd that is not used. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Closes openzfs#11683
rottegift
added a commit
to rottegift/openzfs
that referenced
this pull request
May 2, 2021
rottegift
added a commit
to rottegift/openzfs
that referenced
this pull request
May 3, 2021
rottegift
added a commit
to rottegift/openzfs
that referenced
this pull request
May 5, 2021
rottegift
added a commit
to rottegift/openzfs
that referenced
this pull request
May 6, 2021
sempervictus
pushed a commit
to sempervictus/zfs
that referenced
this pull request
May 31, 2021
Even when supplied with an abd to abd_get_offset_struct(), the call to abd_get_offset_impl() can allocate a different abd. Ensure to call abd_fini_struct() on the abd that is not used. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Closes openzfs#11683
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ABD can be initialised twice - which is a panic on some platforms.
Motivation and Context
Ensure any call to
abd_init_struct();
has a corresponding call toabd_fini_struct();
Description
Even when supplied with an
abd
toabd_get_offset_struct()
, the callto
abd_get_offset_impl()
can allocate a differentabd
. Ensure tocall
abd_fini_struct()
on theabd
that is not used.This was easily triggered on macOS with
zpool_upgrade
zfs-tests. With the stack:How Has This Been Tested?
Lots of tests on macOS - now to make sure it doesn't break for others.
Types of changes
Checklist:
Signed-off-by
.