This is an archive of the discontinued LLVM Phabricator instance.

[SafeStack] Make sure SafeStack does not break musttail call contract
ClosedPublic

Authored by lxfind on Nov 3 2020, 11:37 AM.

Details

Summary

SafeStack instrumentation should not insert anything inbetween musttail call and return instruction.
For every ReturnInst that needs to be instrumented, we adjust the insertion point to the musttail call if exists.

Diff Detail

Event Timeline

lxfind created this revision.Nov 3 2020, 11:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 3 2020, 11:37 AM
lxfind requested review of this revision.Nov 3 2020, 11:37 AM
vitalybuka added inline comments.Nov 5 2020, 4:57 PM
llvm/test/Transforms/SafeStack/X86/musttail.ll
32

the test shows that we don't insert stuff after musttail
it does not show where exactly it goes

maybe just generate the test with llvm-project/llvm/utils/update_test_checks.py?

lxfind updated this revision to Diff 303569.Nov 6 2020, 3:39 PM

auto generate test

rnk accepted this revision.Nov 10 2020, 12:21 PM

lgtm

This revision is now accepted and ready to land.Nov 10 2020, 12:21 PM
This revision was landed with ongoing or failed builds.Nov 10 2020, 8:46 PM
This revision was automatically updated to reflect the committed changes.