gh-134100: Fix UAF in PyImport_ImportModuleLevelObject#134117
Merged
kumaraditya303 merged 6 commits intopython:mainfrom May 18, 2025
Merged
gh-134100: Fix UAF in PyImport_ImportModuleLevelObject#134117kumaraditya303 merged 6 commits intopython:mainfrom
kumaraditya303 merged 6 commits intopython:mainfrom
Conversation
Contributor
Author
|
Not really sure how to add tests for this |
Member
|
Use the repro from the issue for a test. |
Misc/NEWS.d/next/Core_and_Builtins/2025-05-16-17-25-52.gh-issue-134100.5-FbLK.rst
Outdated
Show resolved
Hide resolved
picnixz
reviewed
May 16, 2025
picnixz
reviewed
May 17, 2025
Comment on lines
234
to
235
| with self.assertRaisesRegex(KeyError, r"'a\.b+' not in sys\.modules as expected"): | ||
| __import__(f"{loooong}.c", {"__package__": "a"}, level=1) |
Member
There was a problem hiding this comment.
Suggested change
| with self.assertRaisesRegex(KeyError, r"'a\.b+' not in sys\.modules as expected"): | |
| __import__(f"{loooong}.c", {"__package__": "a"}, level=1) | |
| with self.assertRaisesRegex( | |
| KeyError, | |
| r"'a\.b+' not in sys\.modules as expected", | |
| ): | |
| __import__(f"{loooong}.c", {"__package__": "a"}, | |
| level=1) |
kumaraditya303
approved these changes
May 17, 2025
ZeroIntensity
approved these changes
May 17, 2025
Member
ZeroIntensity
left a comment
There was a problem hiding this comment.
LGTM, with two little technicalities.
Misc/NEWS.d/next/Core_and_Builtins/2025-05-16-17-25-52.gh-issue-134100.5-FbLK.rst
Outdated
Show resolved
Hide resolved
|
Thanks @Nico-Posada for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
May 18, 2025
…ect` (pythonGH-134117) (cherry picked from commit 4e9005d) Co-authored-by: Nico-Posada <[email protected]>
|
GH-134171 is a backport of this pull request to the 3.14 branch. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
May 18, 2025
…ect` (pythonGH-134117) (cherry picked from commit 4e9005d) Co-authored-by: Nico-Posada <[email protected]>
|
GH-134172 is a backport of this pull request to the 3.13 branch. |
Pranjal095
pushed a commit
to Pranjal095/cpython
that referenced
this pull request
Jul 12, 2025
gentoo-bot
pushed a commit
to gentoo/cpython
that referenced
this pull request
Jul 30, 2025
…evelObject` (pythonGH-134117) (python#134172) pythongh-134100: Fix use-after-free in `PyImport_ImportModuleLevelObject` (pythonGH-134117) (cherry picked from commit 4e9005d) Co-authored-by: Nico-Posada <[email protected]> Signed-off-by: Michał Górny <[email protected]>
taegyunkim
pushed a commit
to taegyunkim/cpython
that referenced
this pull request
Aug 4, 2025
This file contains hidden or 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
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.
Decref after using
to_returninstead of before.PyImport_ImportModuleLevelObject#134100