Issue 36253: Use after free in ctypes test suite (original) (raw)

Issue36253

Created on 2019-03-10 00:08 by btharper, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
asan StringPtrTestCase.txt btharper,2019-03-10 00:08 Stack trace of failure
Pull Requests
URL Status Linked Edit
PR 12257 merged btharper,2019-03-10 00:13
Messages (4)
msg337583 - (view) Author: Ben Harper (btharper) * Date: 2019-03-10 00:08
When running the builtin test suite with address sanitizer enabled, one of the ctypes tests causes a use after free demonstrating the danger of using a reference to the inside of a deallocated buffer. This use is detected as an error by the address sanitizer and can be replicated with the following; a stack trace from the resulting failure is attached. export ASAN_OPTIONS="detect_leaks=0" make clean ./configure --with-address-sanitizer --with-pydebug make ./python Lib/ctypes/test/test_stringptr.py StringPtrTestCase -v
msg339258 - (view) Author: Brad Larsen (blarsen) * Date: 2019-03-31 14:01
I was just going to submit a patch for this, then I found this issue. I can confirm; I see the same use-after-free without the fix.
msg351697 - (view) Author: Thomas Wouters (twouters) * (Python committer) Date: 2019-09-10 15:20
New changeset a9b6033179b64b985394ad351501089a6a94fc9d by T. Wouters (Ben Harper) in branch 'master': bpo-36253: Remove use after free reference in ctypes test suite (GH-12257) https://github.com/python/cpython/commit/a9b6033179b64b985394ad351501089a6a94fc9d
msg354198 - (view) Author: Ben Harper (btharper) * Date: 2019-10-08 12:45
Changes merged
History
Date User Action Args
2022-04-11 14:59:12 admin set github: 80434
2019-10-08 12:45:52 btharper set status: open -> closedmessages: + stage: patch review -> resolved
2019-09-10 15:20:18 twouters set nosy: + twoutersmessages: +
2019-03-31 14:01:59 blarsen set nosy: + blarsenmessages: +
2019-03-10 04:36:44 xtreak set nosy: + gregory.p.smith, amaury.forgeotdarc, belopolsky, meador.inge
2019-03-10 00:13:27 btharper set keywords: + patchstage: patch reviewpull_requests: + <pull%5Frequest12243>
2019-03-10 00:08:40 btharper create