Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

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

Merged
merged 4 commits into from
Sep 10, 2019

Conversation

btharper
Copy link
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
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
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