Skip to content
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

Enable Use-After-Return detection in AddressSanitizer #89133

Open
jkoritzinsky opened this issue Jul 18, 2023 · 2 comments · May be fixed by #89204
Open

Enable Use-After-Return detection in AddressSanitizer #89133

jkoritzinsky opened this issue Jul 18, 2023 · 2 comments · May be fixed by #89204
Labels
area-Infrastructure in-pr There is an active PR which will close this issue when it is merged
Milestone

Comments

@jkoritzinsky
Copy link
Member

Use-After-Return detection was disabled when AddressSanitizer was initially stood up because various components in CoreCLR (and possibly NativeAOT) check if a pointer is on the current thread's stack, which doesn't work with the fake stacks that the Use-After-Return detection uses to implement the feature. AddressSanitizer has APIs in its "public interface" that we can use to detect if a pointer is in the current thread's fake stack. We should use this feature in the places where we are asserting that a particular pointer points to the thread's stack and enable the detection.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jul 18, 2023
@ghost
Copy link

ghost commented Jul 18, 2023

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Issue Details

Use-After-Return detection was disabled when AddressSanitizer was initially stood up because various components in CoreCLR (and possibly NativeAOT) check if a pointer is on the current thread's stack, which doesn't work with the fake stacks that the Use-After-Return detection uses to implement the feature. AddressSanitizer has APIs in its "public interface" that we can use to detect if a pointer is in the current thread's fake stack. We should use this feature in the places where we are asserting that a particular pointer points to the thread's stack and enable the detection.

Author: jkoritzinsky
Assignees: -
Labels:

area-Infrastructure

Milestone: -

@jkoritzinsky
Copy link
Member Author

Green threads had a similar issue. This commit has the places that needed to be updated: dotnet/runtimelab@ba2a40d#diff-2683b20032662221023affe4d7e1a689fd966abfe1bd44fb6b65b83571a127ddR2994

Look for the stackPointerLessThan helper.

jkoritzinsky added a commit to jkoritzinsky/runtime that referenced this issue Jul 19, 2023
@jkoritzinsky jkoritzinsky linked a pull request Jul 19, 2023 that will close this issue
@agocke agocke added this to the Future milestone Aug 17, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Aug 17, 2023
@dotnet-policy-service dotnet-policy-service bot added the in-pr There is an active PR which will close this issue when it is merged label Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Infrastructure in-pr There is an active PR which will close this issue when it is merged
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants