-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
[3.13] gh-142560: prevent use-after-free in search-like methods by exporting buffer in bytearray (GH-142938) #142986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… by exporting buffer in bytearray (pythonGH-142938) (cherry picked from commit 220f0b1) Co-authored-by: wangxiaolei <[email protected]>
|
Sadly, the build fails :-( |
|
Will work on resolving in a bit; free threaded build worked for me... i need to improve my local tools for doing multiple builds |
|
Updated to drop the critical sections / locking |
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 👍
But the NEWS entry should be in the Core and Builtins section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. We don't support Free Threading in Python 3.13.
This backport is more intricate as free threading / locking / critical sections was only added to
bytearrayin 3.14. This drops all critical section pieces (thread-safety forbytearraywas added in 3.14)this makesbytearraysafer in 3.13 (The methods that use_bytearray_with_buffershould now be thread safe as it does the critical section), but I did not make all the methods thread safe that are thread safe in 3.14 (Without the clinic annotation doing so well is a lot more difficult)(cherry picked from commit 220f0b1)
bytearraysearch methods via re-entrant__index__#142560