Skip to content
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

Close possible zfs_znode_held() race #4244

Closed
wants to merge 1 commit into from

Conversation

behlendorf
Copy link
Contributor

Check if the lock is held while holding the z_hold_locks() lock.
This prevents a possible use-after-free bug for callers which are
not holding the lock. There currently are no such callers so this
can't cause a problem today but it has been fixed regardless.

Signed-off-by: Brian Behlendorf behlendorf1@llnl.gov
Issue #4124

Check if the lock is held while holding the z_hold_locks() lock.
This prevents a possible use-after-free bug for callers which are
not holding the lock.  There currently are no such callers so this
can't cause a problem today but it has been fixed regardless.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#4124
@behlendorf
Copy link
Contributor Author

@tuxoko a small fix for the issue you spotted in #4124.

@tuxoko
Copy link
Contributor

tuxoko commented Jan 19, 2016

Looks good, though I wonder why you use ? B_TRUE : B_FALSE

@behlendorf
Copy link
Contributor Author

@tuxoko I went back and forth on that. But the return type is a boolean_t and in the end I thought this made things clearer.

behlendorf added a commit that referenced this pull request Jan 29, 2016
Check if the lock is held while holding the z_hold_locks() lock.
This prevents a possible use-after-free bug for callers which are
not holding the lock.  There currently are no such callers so this
can't cause a problem today but it has been fixed regardless.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Closes #4244
Issue #4124
goulvenriou pushed a commit to Alyseo/zfs that referenced this pull request Feb 3, 2016
Check if the lock is held while holding the z_hold_locks() lock.
This prevents a possible use-after-free bug for callers which are
not holding the lock.  There currently are no such callers so this
can't cause a problem today but it has been fixed regardless.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Closes openzfs#4244
Issue openzfs#4124
Flefebvre pushed a commit to Flefebvre/zfs that referenced this pull request Feb 3, 2016
Check if the lock is held while holding the z_hold_locks() lock.
This prevents a possible use-after-free bug for callers which are
not holding the lock.  There currently are no such callers so this
can't cause a problem today but it has been fixed regardless.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Closes openzfs#4244
Issue openzfs#4124
Flefebvre pushed a commit to Flefebvre/zfs that referenced this pull request Feb 3, 2016
Check if the lock is held while holding the z_hold_locks() lock.
This prevents a possible use-after-free bug for callers which are
not holding the lock.  There currently are no such callers so this
can't cause a problem today but it has been fixed regardless.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Closes openzfs#4244
Issue openzfs#4124
Flefebvre pushed a commit to Flefebvre/zfs that referenced this pull request Feb 3, 2016
Check if the lock is held while holding the z_hold_locks() lock.
This prevents a possible use-after-free bug for callers which are
not holding the lock.  There currently are no such callers so this
can't cause a problem today but it has been fixed regardless.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Closes openzfs#4244
Issue openzfs#4124
tuxoko pushed a commit to tuxoko/zfs that referenced this pull request Feb 8, 2016
Check if the lock is held while holding the z_hold_locks() lock.
This prevents a possible use-after-free bug for callers which are
not holding the lock.  There currently are no such callers so this
can't cause a problem today but it has been fixed regardless.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Closes openzfs#4244
Issue openzfs#4124
@behlendorf behlendorf deleted the issue-4124-fix branch April 19, 2021 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants