<div dir="ltr">Yes, let's not rush the fixes, these two issues sound too complicated to pile patches in an attempt to fix. Good thing the distribution issue got caught now, I should have realized that mistake.<div><br></div><div>I reverted in the clang patch in <span style="color:rgb(0,0,0)">r225947 and the LLVM one in </span><span style="color:rgb(0,0,0)">r225948.</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 13, 2015 at 9:24 PM, Stephen Crane <span dir="ltr"><<a href="mailto:sjcrane@uci.edu" target="_blank">sjcrane@uci.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sounds good.<br>
<br>
The test failures on Linux are due to implementation differences in<br>
std::uniform_random_distribution across C++ libs. The mt19937_64 RNG<br>
is guaranteed to be stable across platforms, but the distributions<br>
aren't. My mistake, in rushing to fix the slight bias of simply using<br>
the mod operator, I forgot to check this. I'll code up an unbiased,<br>
portable distribution to convert to [0,100) range tomorrow.<br>
<span class="HOEnZb"><font color="#888888"><br>
- stephen<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Tue, Jan 13, 2015 at 9:19 PM, JF Bastien <<a href="mailto:jfb@chromium.org">jfb@chromium.org</a>> wrote:<br>
> Let me revert for now, and we can figure out a fix tomorrow.<br>
><br>
> On Tue, Jan 13, 2015 at 8:13 PM, Stephen Crane <<a href="mailto:sjcrane@uci.edu">sjcrane@uci.edu</a>> wrote:<br>
>><br>
>> Adding llvm-commits. Sorry, didn't realize it wasn't on here.<br>
>><br>
>> On Tue, Jan 13, 2015 at 7:43 PM, Stephen Crane <<a href="mailto:sjcrane@uci.edu">sjcrane@uci.edu</a>> wrote:<br>
>> > Here's a patch that should fix the RNG distribution initialization<br>
>> > compilation failure on Windows. Relevant buildbot failure:<br>
>> > <a href="http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/16201" target="_blank">http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/16201</a><br>
>> ><br>
>> > I'm not even sure if this static initializer is allowed in LLVM's<br>
>> > codebase. If not, we can just initialize a Distribution for each<br>
>> > runOnMachineFunction or allocate a Distribution in the constructor.<br>
>> ><br>
>> > There are also test failures on Linux. I'll figure out why in a bit<br>
>> > when I've finished recompiling on a linux machine. Relevant BB<br>
>> > failures:<br>
>> > <a href="http://lab.llvm.org:8011/builders/llvm-s390x-linux1/builds/12598" target="_blank">http://lab.llvm.org:8011/builders/llvm-s390x-linux1/builds/12598</a><br>
>> > <a href="http://lab.llvm.org:8011/builders/llvm-aarch64-linux/builds/6051" target="_blank">http://lab.llvm.org:8011/builders/llvm-aarch64-linux/builds/6051</a><br>
>> > <a href="http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/20016" target="_blank">http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/20016</a><br>
>> > <a href="http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/22286" target="_blank">http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/22286</a><br>
>> ><br>
>> > - stephen<br>
>> ><br>
>> > On Tue, Jan 13, 2015 at 5:18 PM, JF Bastien <<a href="mailto:jfb@chromium.org">jfb@chromium.org</a>> wrote:<br>
>> >> Insert random noops to increase security against ROP attacks (llvm)<br>
>> >><br>
>> >> A pass that adds random noops to X86 binaries to introduce diversity<br>
>> >> with the goal of increasing security against most return-oriented<br>
>> >> programming attacks.<br>
>> >><br>
>> >> Command line options:<br>
>> >><br>
>> >>   -noop-insertion // Enable noop insertion.<br>
>> >>   -noop-insertion-percentage=X // X% of assembly instructions will have<br>
>> >> a noop prepended (default: 50%, requires -noop-insertion)<br>
>> >>   -max-noops-per-instruction=X // Randomly generate X noops per<br>
>> >> instruction. ie. roll the dice X times with probability set above (default:<br>
>> >> 1). This doesn't guarantee X noop instructions.<br>
>> >><br>
>> >> In addition, the following 'quick switch' in clang enables basic<br>
>> >> diversity using default settings (currently: noop insertion and schedule<br>
>> >> randomization; it is intended to be extended in the future).<br>
>> >><br>
>> >>   -fdiversify<br>
>> >><br>
>> >> This is the llvm part of the patch.<br>
>> >> clang part: <a href="http://reviews.llvm.org/D3393" target="_blank">http://reviews.llvm.org/D3393</a><br>
>> >><br>
>> >> <a href="http://reviews.llvm.org/D3392" target="_blank">http://reviews.llvm.org/D3392</a><br>
>> >> Patch by Stephen Crane (@rinon)<br>
>> >><br>
>> >><br>
>> >> AFFECTED FILES<br>
>> >>   /llvm/trunk/include/llvm/CodeGen/CommandFlags.h<br>
>> >>   /llvm/trunk/include/llvm/CodeGen/NoopInsertion.h<br>
>> >>   /llvm/trunk/include/llvm/CodeGen/Passes.h<br>
>> >>   /llvm/trunk/include/llvm/InitializePasses.h<br>
>> >>   /llvm/trunk/include/llvm/Support/RandomNumberGenerator.h<br>
>> >>   /llvm/trunk/include/llvm/Target/TargetInstrInfo.h<br>
>> >>   /llvm/trunk/include/llvm/Target/TargetOptions.h<br>
>> >>   /llvm/trunk/lib/CodeGen/CMakeLists.txt<br>
>> >>   /llvm/trunk/lib/CodeGen/CodeGen.cpp<br>
>> >>   /llvm/trunk/lib/CodeGen/NoopInsertion.cpp<br>
>> >>   /llvm/trunk/lib/CodeGen/Passes.cpp<br>
>> >>   /llvm/trunk/lib/Target/X86/X86InstrInfo.cpp<br>
>> >>   /llvm/trunk/lib/Target/X86/X86InstrInfo.h<br>
>> >>   /llvm/trunk/test/CodeGen/Mips/noop-insert.ll<br>
>> >>   /llvm/trunk/test/CodeGen/PowerPC/noop-insert.ll<br>
>> >>   /llvm/trunk/test/CodeGen/X86/noop-insert-percentage.ll<br>
>> >>   /llvm/trunk/test/CodeGen/X86/noop-insert.ll<br>
>> >><br>
>> >> USERS<br>
>> >>   jfb (Author)<br>
>> >>   dsanders (Auditor)<br>
>> >><br>
>> >> <a href="http://reviews.llvm.org/rL225908" target="_blank">http://reviews.llvm.org/rL225908</a><br>
>> >><br>
>> >> EMAIL PREFERENCES<br>
>> >>   <a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
>> >><br>
>> >><br>
><br>
><br>
</div></div></blockquote></div><br></div>