This is an archive of the discontinued LLVM Phabricator instance.

[safestack] Support USP in TCB for musl libc
Needs ReviewPublic

Authored by mlemay-intel on Apr 29 2016, 8:23 PM.

Details

Reviewers
eugenis
pcc
zlei
Summary

This patch stores the Unsafe Stack Pointer (USP) at offset 9*sizeof(uintptr_t)
in the Thread Control Block (TCB) for musl environments.

Event Timeline

mlemay-intel retitled this revision from to [safestack] Support USP at arbitrary offset within TCB.
mlemay-intel updated this object.
mlemay-intel retitled this revision from [safestack] Support USP at arbitrary offset within TCB to [safestack] Support USP in TCB for musl libc.May 3 2016, 9:17 PM
mlemay-intel updated this object.
mlemay-intel added reviewers: pcc, eugenis.
mlemay-intel added a subscriber: llvm-commits.

Revised this to be specific to musl libc on X86.

mlemay-intel updated this object.Sep 2 2016, 2:17 PM

Revised patch so that it no longer modifies X86 subtarget.

Updated so that USP is stored in TCB for all musl libc environments on X86,
rather than just those on Linux with the separate stack segment feature enabled.

My original musl libc patches just supported SafeStack with the separate stack
segment feature enabled, but I recently divided them into two series. The first
series provides architecture-independent support for SafeStack including the
support for storing USP in the TCB. The second series adds support for the
separate stack segment feature.

By the way, I would welcome feedback on my musl libc patches from the LLVM
community, especially from those of you that have experience developing runtime
support for SafeStack such as @pcc and @eugenis. My recent posts are listed at
http://www.openwall.com/lists/musl/2016/10/28/ .