Uh oh!
There was an error while loading. Please reload this page.
bpo-46561: Ensure operands to __get__ survive the call - #30979
bpo-46561: Ensure operands to __get__ survive the call#30979tekknolagi wants to merge 3 commits into
Conversation
Callees can assume their parameters survive for the entire call. This violates that assumption and can cause a use-after-free. This is not an issue in CPython right now because later on in the interpreter __get__ fastcall path, the whole vector of arguments get INCREFed. However, if a program provides a different entrypoint for a vectorcall, it may crash.
8729722 to
a47eaacComparemarkshannon
commented
Feb 1, 2022
The changes look good, could you add some test cases? |
tekknolagi
commented
Feb 1, 2022
I am working on making a C-API equivalent for your sample Python test code. Unfortunately, it is not so easy as making a C extension class with |
Summary: Callees can assume their parameters survive for the entire call. This violates that assumption and can cause a use-after-free. Similar to D27254519. See python/cpython#30979. Reviewed By: swtaarrs Differential Revision: D33699901 fbshipit-source-id: 677d97d
tekknolagi
commented
Feb 23, 2024
Lol, did this finally bite someone else? |
serhiy-storchaka
commented
Feb 23, 2024
I am on a mission to review old PRs that were not reviewed by anybody. LGTM, but please fix the NEWS entry (and its text is not very clear, it could be improved). It would be nice to add tests, but if it is too complicated, it is not necessary. |
This PR is stale because it has been open for 30 days with no activity. |
serhiy-storchaka
commented
Jun 4, 2026
@tekknolagi, please sign the CLA. This is needed to merge this PR. |
serhiy-storchaka
commented
Jun 4, 2026
Well, it was fixed by GH-118454. |
tekknolagi
commented
Jun 4, 2026
I feel like I've signed the CLA like 3 times. I'll sign it again if needed. But also, I'm not sure if Dino's patch does address it? It looks like a SETREF after the call. |
tekknolagi
commented
Jun 4, 2026
Oh. I had signed the old CLA. I signed the new one. |
serhiy-storchaka
commented
Jun 4, 2026
Thank you. That bug has been fixed in other PR after I approved this PR and before I have opportunity to return to it (and I didn't because you didn't update the entry in the NEWS section). But this will help with your other PRs. |
serhiy-storchaka
commented
Jun 4, 2026
Before your patch, |
Callees can assume their parameters survive for the entire call. This
violates that assumption and can cause a use-after-free.
https://bugs.python.org/issue46561