Page MenuHomePhabricator

[safestack] Do not link SafeStack runtime for musl environments
AcceptedPublic

Authored by mlemay-intel on Apr 15 2016, 11:09 AM.

Details

Summary

Musl libc provides runtime support for SafeStack, so the default
SafeStack library from compiler-rt is not needed.

Event Timeline

mlemay-intel retitled this revision from to [safestack] Link SafeStack runtime only when not using separate stack segment.
mlemay-intel updated this object.
eugenis edited edge metadata.Apr 15 2016, 1:14 PM

Test, please.
Where is this runtime support implemented? Some platform's libc, or an external library?

Test, please.

Do you know of any examples of the sort of test that you would like to see for a feature like this?

Where is this runtime support implemented? Some platform's libc, or an external library?

In my experience, supporting a separate stack segment seems to require a modified libc. The whole program, including libc routines, needs to be recompiled to direct memory accesses to the appropriate segment. This requires setting up an unsafe stack early enough that those recompiled routines can run successfully.

Test, please.

Do you know of any examples of the sort of test that you would like to see for a feature like this?

test/Driver/sanitizer-ld.c

mlemay-intel edited edge metadata.

Add test.

eugenis accepted this revision.Apr 15 2016, 3:08 PM
eugenis edited edge metadata.

LGTM

This revision is now accepted and ready to land.Apr 15 2016, 3:08 PM

Looks like patch was not committed.

Looks like patch was not committed.

This patch, D17092, D17094, and D17095 are all interdependent. I think it makes sense to wait until all four are approved so that they can all be committed together.

Please add dependencies to Differential revisions, so reasons for holding will be clear.

mlemay-intel edited edge metadata.

Disabled linking of the compiler-rt SafeStack runtime library for musl
environments rather than for targets that use the separate stack segment
feature. This reflects changes in my proposed musl libc patches to add
architecture-independent support for storing USP in the TCB.

mlemay-intel retitled this revision from [safestack] Link SafeStack runtime only when not using separate stack segment to [safestack] Do not link SafeStack runtime for musl environments.Nov 1 2016, 2:41 PM
mlemay-intel updated this object.