Commit 0c4f336
pythongh-106092: Fix use-after-free crash in frame_dealloc (pythonGH-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>1 parent 3be07c9 commit 0c4f336
2 files changed
Lines changed: 9 additions & 6 deletions
File tree
- Misc/NEWS.d/next/Core and Builtins
- Objects
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
851 | 851 | | |
852 | 852 | | |
853 | 853 | | |
854 | | - | |
855 | | - | |
856 | | - | |
857 | 854 | | |
858 | 855 | | |
859 | 856 | | |
860 | 857 | | |
861 | 858 | | |
862 | 859 | | |
863 | 860 | | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
864 | 867 | | |
865 | | - | |
866 | | - | |
867 | | - | |
| 868 | + | |
868 | 869 | | |
869 | 870 | | |
870 | 871 | | |
| |||
0 commit comments