patch submission: x86 trapsleds

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 02:02:16 PDT 2017


On Wed, Jul 19, 2017 at 09:35:58PM -0400, Todd Mortimer via llvm-commits wrote:
> I have attached a patch that converts NOP padding emitted by
> X86AsmBackend::writeNopData into a short JMP over a sequence of INT3
> insructions. The idea is to remove potentially convenient NOP sleds
> which may be used in ROP attacks. Programs which would have normally
> executed through a NOP sled will now just JMP over the INT3s, but an
> attacker hoping to hit the NOP sled on their way to some code will now
> get a core dump.

I don't believe turning a single padding instruction into a jump is a
good idea for any intra-function place. You should at the very least
demonstrate the performance (non-)regression by running LNT. You will
also need at least a functional test case before this can be further
considered. Note that the lld case is completely different -- it is only
about inter-function padding.

Joerg


More information about the llvm-commits mailing list