Skip to content

gh-126138: Fix UAF in asyncio.Task when task calls back to user defined cancel function - #126305

Merged
kumaraditya303 merged 4 commits into
python:mainfrom
Nico-Posada:fix-issue-126138
Nov 2, 2024
Merged

gh-126138: Fix UAF in asyncio.Task when task calls back to user defined cancel function#126305
kumaraditya303 merged 4 commits into
python:mainfrom
Nico-Posada:fix-issue-126138

Conversation

@Nico-Posada

@Nico-PosadaNico-Posada commented Nov 1, 2024

Copy link
Copy Markdown
Contributor

No test cases because of how similar this is to #126120, but can add if needed. Blurb definitely needs some revision too because I'm bad at explaining things sometimes.

@Nico-Posada

Copy link
Copy Markdown
ContributorAuthor

Oh it seems I pulled in my change from #126230 too, don't think it'll cause any issues though. Can remove if needed.

@picnixzpicnixz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch Nico! I gave you some suggestions for the comments but feel free to change where the line ends (hard to see where the 80-chars limit lie on GH Web UI).

Comment threadModules/_asynciomodule.c Outdated
Comment threadModules/_asynciomodule.c Outdated
Comment threadModules/_asynciomodule.c Outdated
Comment threadModules/_asynciomodule.c Outdated
Comment threadMisc/NEWS.d/next/Library/2024-11-01-14-31-41.gh-issue-126138.yTniOG.rst Outdated
Comment threadModules/_asynciomodule.c Outdated
Comment threadModules/_asynciomodule.c Outdated
@picnixzpicnixz added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Nov 1, 2024
@miss-islington-app

Copy link
Copy Markdown

Thanks @Nico-Posada for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 2, 2024
…attribute__` (pythonGH-126305)
(cherry picked from commit f032f6b)
Co-authored-by: Nico-Posada <102486290+Nico-Posada@users.noreply.github.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 2, 2024
…attribute__` (pythonGH-126305)
(cherry picked from commit f032f6b)
Co-authored-by: Nico-Posada <102486290+Nico-Posada@users.noreply.github.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
@bedevere-app

Copy link
Copy Markdown

GH-126324 is a backport of this pull request to the 3.13 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.13 bugs and security fixes label Nov 2, 2024
@bedevere-app

Copy link
Copy Markdown

GH-126325 is a backport of this pull request to the 3.12 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.12 only security fixes label Nov 2, 2024
kumaraditya303 pushed a commit that referenced this pull request Nov 2, 2024
…tattribute__` (GH-126305) (#126325)
gh-126138: Fix use-after-free in `_asyncio.Task` by evil `__getattribute__` (GH-126305)
(cherry picked from commit f032f6b)
Co-authored-by: Nico-Posada <102486290+Nico-Posada@users.noreply.github.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
kumaraditya303 pushed a commit that referenced this pull request Nov 2, 2024
…tattribute__` (GH-126305) (#126324)
gh-126138: Fix use-after-free in `_asyncio.Task` by evil `__getattribute__` (GH-126305)
(cherry picked from commit f032f6b)
Co-authored-by: Nico-Posada <102486290+Nico-Posada@users.noreply.github.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
picnixz pushed a commit to picnixz/cpython that referenced this pull request Dec 8, 2024
…attribute__` (python#126305)
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
…attribute__` (python#126305)
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Nico-Posada@picnixz@kumaraditya303@willingc