Skip to content

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

Merged
Yhg1s merged 1 commit into
python:3.12from
miss-islington:backport-557b05c-3.12
Aug 1, 2023
Merged

Yhg1s merged 1 commit into
python:3.12from
miss-islington:backport-557b05c-3.12

Conversation

@miss-islington

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

Copy link
Copy Markdown
Contributor

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 andersk@mit.edu
Signed-off-by: Anders Kaseorg andersk@mit.edu

…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 <andersk@mit.edu>
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
@markshannon

Copy link
Copy Markdown
Member
@Yhg1s
Yhg1s merged commit b68faa3 into python:3.12 Aug 1, 2023
@miss-islington
miss-islington deleted the backport-557b05c-3.12 branch August 1, 2023 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants