Skip to content

bpo-36253: Remove use after free reference in ctypes test suite#12257

Merged
Yhg1s merged 4 commits intopython:masterfrom
btharper:ctypes_uaf
Sep 10, 2019
Merged

bpo-36253: Remove use after free reference in ctypes test suite#12257
Yhg1s merged 4 commits intopython:masterfrom
btharper:ctypes_uaf

Conversation

@btharper
Copy link
Copy Markdown
Contributor

@btharper btharper commented Mar 10, 2019

Removes invalid reference to freed memory in ctypes test case.

Once buf is deleted and freed r becomes a dangling pointer, further use requires reading from freed memory.

Bug found using asan, full details and stack trace attached in the bug tracker.

https://bugs.python.org/issue36253

Copy link
Copy Markdown
Contributor

@jdemeyer jdemeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matrixise Does this needs a NEWS entry? I don't think so, it would just clutter the changelog. I ask you since you've been adding skip news labels to various of my PRs.

Other than that, I approve the patch. The point of that test is unclear to me.

Remove unnecessary elaboration of the old (bad, useless) test. Just mention that 'r' is now a dangling pointer and leave it at that.
Delete the news blurb, as minor changes to the ctypes test suite are not newsworthy.
@Yhg1s Yhg1s self-assigned this Sep 10, 2019
@Yhg1s
Copy link
Copy Markdown
Member

Yhg1s commented Sep 10, 2019

This doesn't need a news entry, no.

@Yhg1s Yhg1s merged commit a9b6033 into python:master Sep 10, 2019
@btharper btharper deleted the ctypes_uaf branch October 6, 2019 04:39
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants