Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

backport r282152 #29

Merged
merged 1 commit into from
Jan 5, 2017
Merged

backport r282152 #29

merged 1 commit into from
Jan 5, 2017

Conversation

japaric
Copy link
Member

@japaric japaric commented Jan 5, 2017

With this we can use ThreadSanitizer with PIE executables running on recent Linux kernels

r? @alexcrichton

4.1+ Linux kernels map pie binaries at 0x55:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d1fd836dcf00d2028c700c7e44d2c23404062c90
Currently tsan does not support app memory at 0x55 (google/sanitizers#503).
Older kernels also map pie binaries at 0x55 when ASLR is disables (most notably under gdb).

This change extends tsan mapping for linux/x86_64 to cover 0x554-0x568 app range and fixes both 4.1+ kernels and gdb.

This required to slightly shrink low and high app ranges and move heap. The mapping become even more non-linear, since now we xor lower bits. Now even a continuous app range maps to split, intermixed shadow ranges. This breaks ShadowToMemImpl as it assumes linear mapping at least within a continuous app range (however it turned out to be already broken at least on arm64/42-bit vma as uncovered by r281970). So also change ShadowToMemImpl to hopefully a more robust implementation that does not assume a linear mapping.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282152 91177308-0d34-0410-b5e6-96231b3b80d8
@japaric
Copy link
Member Author

japaric commented Jan 5, 2017

cc rust-lang/rust#38699

@alexcrichton alexcrichton merged commit 4254a55 into rust-lang:rust-llvm-2016-07-18 Jan 5, 2017
@japaric japaric deleted the rust-llvm-2016-07-18 branch January 5, 2017 17:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants