GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||
GeezerVison is showing github.com — gh-134144: Fix use-after-free in zapthreads() by b-pass · Pull Request #134145 · python/cpython Conversation
|
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure we can drop zapthreads entirely, because right now the assumption is that the interpreter doesn't have any threads left. Let's hold off on this until we come to a decision on what the actual behavior should be for dangling threads.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We just need a NEWS entry.
@ZeroIntensity, regarding gh-128640, I expect we'll do that too since it solves an additional problem. However, this PR is a good idea regardless.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
We need a test as well, but I'm more worried about the use-case as given in the issue. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Sorry, the issue description isn't great. The thread wasn't alive, but for (PyThreadState *tstate = interp->threads.head; tstate != NULL; tstate = tstate->next) { free(tstate); } |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Right, I've noticed this before. In most cases, we get lucky because the initial thread is statically allocated on the interpreter state, so it doesn't actually cause UAF. It becomes an issue with something like |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
It happens without the Ensure. I've updated the linked issue with a complete program (without an Ensure). So are you saying it's not supported to use a different |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Yes, and you can't have any additional threads when you call I'm fine with this fix, but my point is that it's not enough. Let's add a test and then I'll approve. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Yeah, a test would be nice. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…Zik.rst Co-authored-by: Peter Bierma <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's go with this.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @b-pass for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
(cherry picked from commit f2de1e6) Co-authored-by: b-pass <[email protected]>
|
GH-134182 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Cannot safely Py_EndInterpreter in 3.14b1
There was an error while loading. Please reload this page.