<div dir="ltr">Hi all,<div><br></div><div>To elaborate on what Stephen said, compile-time nop insertion is only effective if the adversary and victim have different versions of the same binary. This obviously creates difficulties w.r.t. binary distribution and subsequent updates*. That said, my colleagues and I at UCI did attempt to upstream a nop insertion pass into LLVM a couple of years ago. You can find patches for LLVM 3.8.1 that allow nop insertion and many other randomizing transformations here: <a href="https://github.com/securesystemslab/multicompiler">https://github.com/securesystemslab/multicompiler</a> (Some of these have been forward ported to LLVM 7 as well but I don't believe the code has been made public yet.)</div><div><br></div><div>Thanks,<br>Per</div><div><br></div><div>*We built a robust load-time randomizer that does function shuffling that works with off the shelf compilers and loaders, not sure if that's of interest in your case: <a href="https://github.com/immunant/selfrando">https://github.com/immunant/selfrando</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 21, 2019 at 4:01 PM Stephen Checkoway via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
> On Nov 21, 2019, at 14:23, Robinson, Paul via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> <br>
> Some years ago there was a random-nop-insertion pass (for ROP gadget removal) proposed, which didn't stick; we recently had a summer intern work on it but did not get to proper quality; I'd like to revive that.<br>
<br>
Hi Paul,<br>
<br>
I'm curious about what the use case for this was. In the normal course of binary distribution of programs, the addition of nops doesn't affect ROP in any significant way. (For a while, inserting a nop before a ret broke ROPgadget's [1] ability to find interesting code sequences since it was looking for fixed sequences of instructions.)<br>
<br>
I could imagine it being used for JITted code. If that was the use case in mind, did you happen to compare it to other randomized codegen?<br>
<br>
I'm only curious because this has historically been an area of research of mine [2,3,4], not any sort of pressing matter.<br>
<br>
Thank you,<br>
<br>
Steve<br>
<br>
<br>
1. <a href="https://github.com/JonathanSalwan/ROPgadget" rel="noreferrer" target="_blank">https://github.com/JonathanSalwan/ROPgadget</a><br>
2. <a href="https://checkoway.net/papers/evt2009/evt2009.pdf" rel="noreferrer" target="_blank">https://checkoway.net/papers/evt2009/evt2009.pdf</a><br>
3. <a href="https://checkoway.net/papers/noret_ccs2010/noret_ccs2010.pdf" rel="noreferrer" target="_blank">https://checkoway.net/papers/noret_ccs2010/noret_ccs2010.pdf</a><br>
4. <a href="https://checkoway.net/papers/fcfi2014/fcfi2014.pdf" rel="noreferrer" target="_blank">https://checkoway.net/papers/fcfi2014/fcfi2014.pdf</a><br>
<br>
-- <br>
Stephen Checkoway<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>