mirror of
https://github.com/python/cpython.git
synced 2025-10-29 01:22:59 +00:00
gh-117657: Fix QSBR race condition (#118843)
`_Py_qsbr_unregister` is called when the PyThreadState is already detached, so the access to `tstate->qsbr` isn't safe without locking the shared mutex. Grab the `struct _qsbr_shared` from the interpreter instead.
This commit is contained in:
parent
22d5185308
commit
33d20199af
4 changed files with 8 additions and 8 deletions
|
|
@ -140,7 +140,7 @@ _Py_qsbr_register(struct _PyThreadStateImpl *tstate,
|
|||
|
||||
// Disassociates a PyThreadState from the QSBR state and frees the QSBR state.
|
||||
extern void
|
||||
_Py_qsbr_unregister(struct _PyThreadStateImpl *tstate);
|
||||
_Py_qsbr_unregister(PyThreadState *tstate);
|
||||
|
||||
extern void
|
||||
_Py_qsbr_fini(PyInterpreterState *interp);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue