-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-142829: Fix use-after-free in Context.__eq__ via re-entrant ContextVar.set #142905
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
gh-142829: Fix use-after-free in Context.__eq__ via re-entrant ContextVar.set #142905
Conversation
sobolevn
left a comment
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 is what we commonly do to solve such issues.
|
Can you add a test which does the same but with |
@kumaraditya303 I think |
@kumaraditya303 Gentle reminder on this. |
|
Thanks @Abdoulrasheed for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
|
Thanks @Abdoulrasheed for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
Sorry, @Abdoulrasheed and @kumaraditya303, I could not cleanly backport this to |
…t `ContextVar.set` (pythonGH-142905) (cherry picked from commit a4086d7) Co-authored-by: A.Ibrahim <abdulrasheedibrahim47@gmail.com>
|
GH-143627 is a backport of this pull request to the 3.14 branch. |
|
Looks like backport to 3.13 failed. @kumaraditya303 |
This fix holds strong references to the HAMT objects and their keys/values during comparison in
_PyHamt_Eq, preventing premature deallocation.Context.__eq__via re-entrantContextVar.set#142829