<div dir="auto">I know Chandler is working on a different, hopefully less expensive, mitigation based on load masking. He has a document that he is polishing that should be sent for RFC soon.</div><br><div class="gmail_quote"><div dir="ltr">On Wed, Mar 21, 2018, 5:59 AM Dallman, John via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">






<div>
<font face="Calibri" size="2"><span style="font-size:10pt">
<div>As far as I've been able to learn, the only way to avoid security vulnerabilities due to Spectre variant 1 (<font size="2"><span style="font-size:11pt">CVE-2017-5753, “bounds check bypass”) is to insert fences to control the relevant speculative reads.
I'm interested in doing this because I work on a numerical modelling library that is used in many applications, which are used to handle valuable information. There's been at least one piece of malware that specifically targeted one of those applications, so
I work at a moderate level of paranoia. </span></font></div>
<div><font size="2"><span style="font-size:11pt"> </span></font></div>
<div><font size="2"><span style="font-size:11pt">I've found information about __builtin_load_no_speculate, but inserting those by hand into ten million lines of branchy C code that's under active development is not an attractive prospect.</span></font></div>
<div><font size="2"><span style="font-size:11pt"> </span></font></div>
<div><font size="2"><span style="font-size:11pt">MSVC has recently gained a /QSpectre option that tries to do this for you (<a href="https://blogs.msdn.microsoft.com/vcblog/2018/01/15/spectre-mitigations-in-msvc/" target="_blank" rel="noreferrer"><font color="#0563C1"><u>https://blogs.msdn.microsoft.com/vcblog/2018/01/15/spectre-mitigations-in-msvc/</u></font></a>).
It only handles a very limited range of cases at present (<a href="https://www.paulkocher.com/doc/MicrosoftCompilerSpectreMitigation.html" target="_blank" rel="noreferrer"><font color="#0563C1"><u>https://www.paulkocher.com/doc/MicrosoftCompilerSpectreMitigation.html</u></font></a>), but Microsoft
are working on improving that. Red Hat tell me that there is work underway to add something similar to GCC, although it's probably a year away. </span></font></div>
<div><font size="2"><span style="font-size:11pt"> </span></font></div>
<div><font size="2"><span style="font-size:11pt">While such a capability can't be completely fool-proof, I can well believe that it's possible to do as good a job as bored humans, and it will be much cheaper.  </span></font></div>
<div><font size="2"><span style="font-size:11pt"> </span></font></div>
<div>Are there any plans to add something equivalent to Clang? </div>
<div><font size="2"><span style="font-size:11pt"> </span></font></div>
<div>Thanks,</div>
<div><font size="2"><span style="font-size:11pt"> </span></font></div>
<div>-- </div>
<div>John Dallman</div>
<div>DF PL TO OT PC PDE</div>
<div>Technology & Innovation</div>
<div><font size="2"><span style="font-size:11pt"><i>Nullius in verba</i></span></font></div>
<div><font size="2"><span style="font-size:11pt"> </span></font></div>
<div>Siemens Industry Sector</div>
<div>Siemens Industry Software Limited </div>
<div>Francis House, 112 Hills Road,</div>
<div>Cambridge CB2 1PH, United Kingdom </div>
<div>Tel.      :+44 (1223) 371554</div>
<div>Fax       :+44 (1223) 371700</div>
<div><font size="2"><span style="font-size:11pt"><a href="mailto:john.dallman@siemens.com" target="_blank" rel="noreferrer"><font color="#0563C1"><u>john.dallman@siemens.com </u></font></a></span></font></div>
<div><font size="2"><span style="font-size:11pt"><a href="http://www.siemens.com/plm" target="_blank" rel="noreferrer"><font color="#0563C1"><u>www.siemens.com/plm </u></font></a></span></font></div>
<div><font size="2"><span style="font-size:11pt"> </span></font></div>
<div><font size="2"><span style="font-size:11pt"> </span></font></div>
<div><font face="Arial" size="3"><span style="font-size:12pt">-----------------<br>

Siemens Industry Software Limited is a limited company registered in England and Wales.<br>

Registered number: 3476850.<br>

Registered office: Faraday House, Sir William Siemens Square, Frimley, Surrey, GU16 8QD. </span></font></div>
</span></font>
</div>

_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" rel="noreferrer">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>