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

[3.11] gh-106092: Fix use-after-free crash in frame_dealloc (GH-106875) #107533

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Aug 1, 2023

It was possible for the trashcan to delay the deallocation of a
PyFrameObject until after its corresponding _PyInterpreterFrame has
already been freed. So frame_dealloc needs to avoid dereferencing the
f_frame pointer unless it first checks that the pointer still points
to the interpreter frame within the frame object.

(cherry picked from commit 557b05c)

Co-authored-by: Anders Kaseorg [email protected]
Signed-off-by: Anders Kaseorg [email protected]

…106875)

It was possible for the trashcan to delay the deallocation of a
PyFrameObject until after its corresponding _PyInterpreterFrame has
already been freed.  So frame_dealloc needs to avoid dereferencing the
f_frame pointer unless it first checks that the pointer still points
to the interpreter frame within the frame object.

(cherry picked from commit 557b05c)

Co-authored-by: Anders Kaseorg <[email protected]>
Signed-off-by: Anders Kaseorg <[email protected]>
@markshannon
Copy link
Member

@pablogsal

@pablogsal pablogsal merged commit 46cae02 into python:3.11 Aug 1, 2023
15 checks passed
@miss-islington miss-islington deleted the backport-557b05c-3.11 branch August 1, 2023 10:21
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.

5 participants