This is an archive of the discontinued LLVM Phabricator instance.

[MSAN][MIPS] Changed memory mapping to support pie executable.
ClosedPublic

Authored by slthakur on Jul 30 2016, 4:28 AM.

Details

Diff Detail

Repository
rL LLVM

Event Timeline

slthakur updated this revision to Diff 66223.Jul 30 2016, 4:28 AM
slthakur retitled this revision from to [MSAN][MIPS] Changed memory mapping to support pie executable..
slthakur updated this object.
slthakur added reviewers: eugenis, kcc, samsonov.
slthakur set the repository for this revision to rL LLVM.
slthakur added a project: Restricted Project.
eugenis accepted this revision.Aug 1 2016, 11:10 AM
eugenis edited edge metadata.

lgtm

lib/msan/msan.h
46

Is that for a non-PIE executable? So, the new mapping requires PIE?

This revision is now accepted and ready to land.Aug 1 2016, 11:10 AM
slthakur added inline comments.Aug 2 2016, 9:42 AM
lib/msan/msan.h
46

Yes, this is for non-PIE executable. And the new mapping requires PIE executable.

This LGTM, but you may want to try and fit both PIE and non-PIE in one mapping the way it's done for Linux x86_64.
Should be possible as long as you can narrow one of these down to carve space for shadow/origin region of the non-PIE app mapping space:
- 0xa000000000-0xc000000000: PIE program segments
- 0xe000000000-0xffffffffff: libraries segments.

slthakur updated this revision to Diff 66937.Aug 5 2016, 6:16 AM
slthakur edited edge metadata.

Addressed review comment

How about this:
MEM_TO_SHADOW = x ^ 0x800...
SHADOW_TO_ORIGIN = x + 0x200...
and
0x0000000000-0x0200000000: Program own segments
0xa200000000-0xc000000000: PIE program segments
0xe200000000-0xffffffffff: libraries segments.

That's about 2x more address space, and I don't see any overlaps.

slthakur updated this revision to Diff 68165.Aug 16 2016, 5:52 AM

Changed Memory mapping as per suggestion

slthakur closed this revision.Aug 16 2016, 5:59 AM

Committed in rL278793