This is an archive of the discontinued LLVM Phabricator instance.

tsan: fix mmap atomicity
ClosedPublic

Authored by dvyukov on Jun 19 2021, 3:56 AM.

Details

Summary

Mmap interceptor is not atomic in the sense that it
exposes unmapped shadow for a brief period of time.
This breaks programs that mmap over another mmap
and access the region concurrently.
Don't unmap shadow in the mmap interceptor to fix this.
Just mapping new shadow on top should be enough to zero it.

Diff Detail

Event Timeline

dvyukov created this revision.Jun 19 2021, 3:56 AM
dvyukov requested review of this revision.Jun 19 2021, 3:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 19 2021, 3:56 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
vitalybuka accepted this revision.Jun 22 2021, 6:15 PM
This revision is now accepted and ready to land.Jun 22 2021, 6:15 PM
This revision was automatically updated to reflect the committed changes.