FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.14] gh-149816: Fix UAF in Modules/_pickle.c (GH-150024) by nascheme · Pull Request #153719 · python/cpython · GitHub

/ cpython Public

[3.14] gh-149816: Fix UAF in Modules/_pickle.c (GH-150024) - #153719

Merged
nascheme merged 1 commit into
python:3.14from
nascheme:ft-backport/gh-149816-3.14
Jul 17, 2026
Merged

[3.14] gh-149816: Fix UAF in Modules/_pickle.c (GH-150024)#153719
nascheme merged 1 commit into
python:3.14from
nascheme:ft-backport/gh-149816-3.14

Conversation

nascheme commented Jul 14, 2026
edited
Loading

Copy link
Copy Markdown
Member

gh-149816: Fix UAF in Modules/_pickle.c (GH-150024)

Backport note: 3.14's batch_list_exact() has the single-item fast path before the batch loop; main moved it inside the loop, which changes the emitted pickle byte stream (APPEND vs MARK ... APPENDS for a trailing single item). To avoid changing 3.14's pickle output, 3.14's structure was kept and only the fix applied: the borrowed PyList_GET_ITEM() + Py_INCREF() became PyList_GetItemRef(), and the list changed size during iteration RuntimeError check was added after each batch. The upstream regression test (test_pickle_dumps_with_concurrent_list_mutations) tolerates RuntimeError/IndexError and passes unchanged.

(cherry picked from commit d095ceb)

Co-authored-by: Alexey Katsman alex2007508@gmail.com
Co-authored-by: Gregory P. Smith 68491+gpshead@users.noreply.github.com

(cherry picked from commit d095ceb)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Alexey Katsman <alex2007508@gmail.com>

python-cla-bot Bot commented Jul 14, 2026
edited
Loading

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

nascheme merged commit 7ed9b91 into python:3.14 Jul 17, 2026
53 checks passed
nascheme deleted the ft-backport/gh-149816-3.14 branch July 17, 2026 20:09
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL