Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-125969: fix OOB in future_schedule_callbacks due to an evil call_soon#125970
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-125969: fix OOB in future_schedule_callbacks due to an evil call_soon#125970
Uh oh!
There was an error while loading. Please reload this page.
Conversation
picnixz commented Oct 25, 2024 • edited by bedevere-app bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by bedevere-app bot
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
asvetlov 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.
Good catch!
Please address notes.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
picnixz commented Oct 25, 2024
I have made the requested changes; please review again. |
Thanks for making the requested changes! @asvetlov: please review the changes made to this pull request. |
asvetlov commented Oct 25, 2024
LGTM! |
Uh oh!
There was an error while loading. Please reload this page.
Nico-Posada commented Oct 25, 2024
This might need a new issue opened, but you can still UAF on callback0 using a malicious getattribute in the loop obj importasyncioclassEvilLoop: defcall_soon(*args): # will crash before it actually gets here print(args) defget_debug(self): returnFalsedef__getattribute__(self, name): globaltrackerifname=="call_soon": fut.remove_done_callback(tracker) deltrackerprint("returning get_soon fn after clearing callback0") returnobject.__getattribute__(self, name) classTrackDel: def__del__(self): print("deleted", self) fut=asyncio.Future(loop=EvilLoop()) tracker=TrackDel() fut.add_done_callback(tracker) fut.set_result("kaboom") |
picnixz commented Oct 25, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Let's have another issue for this one. I only noticed the OOB issue when splitting the PR. See: #125984. |
willingc commented Oct 25, 2024
Thanks @asvetlov for the review. I hope all is going well with you. |
asvetlov commented Oct 25, 2024
Thank you, @willingc, I'm good. |
kumaraditya303 commented Oct 25, 2024
Good to see you back @asvetlov |
Thanks @picnixz for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
…l `call_soon` (pythonGH-125970) (cherry picked from commit c5b99f5) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
…l `call_soon` (pythonGH-125970) (cherry picked from commit c5b99f5) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
GH-125991 is a backport of this pull request to the 3.13 branch. |
GH-125992 is a backport of this pull request to the 3.12 branch. |
asvetlov commented Oct 25, 2024
thanks, @kumaraditya303 |
…l `call_soon` (python#125970) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
call_soonmay cause OOB infuture_schedule_callbacks#125969