This is an archive of the discontinued LLVM Phabricator instance.

[asan] Refactor stack unpoisoning.
ClosedPublic

Authored by robot on Jun 10 2020, 8:37 AM.

Details

Summary

This adds a customization point to support unpoisoning of signal alternate stacks on POSIX.

Diff Detail

Event Timeline

robot created this revision.Jun 10 2020, 8:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 10 2020, 8:37 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
robot added a comment.Jun 10 2020, 8:48 AM

Not sure if I got the parent/child relation right in Phabricator. This change is supposed to come first, before D81577.

robot retitled this revision from [asan] Refactor fetching of stack boundaries. to [asan] Refactor stack unpoisoning..Jun 10 2020, 8:58 AM
robot edited the summary of this revision. (Show Details)
vitalybuka accepted this revision.Jun 10 2020, 6:22 PM

Thank you!
LGTM

compiler-rt/lib/asan/asan_rtl.cpp
554

static void UnpoisonStack()

592

static

This revision is now accepted and ready to land.Jun 10 2020, 6:22 PM
vitalybuka added inline comments.Jun 10 2020, 6:48 PM
compiler-rt/lib/asan/asan_rtl.cpp
579

Can you please also extract "if (top - bottom > kMaxExpectedCleanupSize) {" block into a function
and use it from PlatformUnpoisonStacks
I missed that PlatformUnpoisonStacks still needs to unpoison main stack. I assumed that return false is going to be enough.

robot updated this revision to Diff 270236.Jun 11 2020, 2:23 PM
robot marked 2 inline comments as done.

Restrict linkage, factor out UnpoisonStack with warning.

robot marked an inline comment as done.Jun 11 2020, 2:24 PM
This revision was automatically updated to reflect the committed changes.