<div>Are all current Python builds and C extensions vulnerable to Spectre variants {1, 2, *}?<br></div><div><br></div>There are now multiple threads:<div><br><div>"SEC: Spectre variant 2: GCC: -mindirect-branch=thunk -mindirect-branch-register"</div><div><div>- <a href="https://mail.python.org/mm3/archives/list/distutils-sig@python.org/thread/4BGE226DB5EWIAT5VCJ75QD5ASOVJZCM/">https://mail.python.org/mm3/archives/list/distutils-sig@python.org/thread/4BGE226DB5EWIAT5VCJ75QD5ASOVJZCM/</a></div><div>- <a href="https://mail.python.org/pipermail/python-ideas/2018-September/053473.html">https://mail.python.org/pipermail/python-ideas/2018-September/053473.html</a></div><div>- <a href="https://mail.python.org/pipermail/python-dev/2018-September/155199.html">https://mail.python.org/pipermail/python-dev/2018-September/155199.html</a></div><div><br></div><div><br></div><div>Original thread (that I forwarded to security@):</div><div>"[Python-ideas] Executable space protection: NX bit,"</div><div><a href="https://mail.python.org/pipermail/python-ideas/2018-September/053175.html">https://mail.python.org/pipermail/python-ideas/2018-September/053175.html</a></div><div>> ~ Do trampolines / nested functions in C extensions switch off the NX bit?</div><div><br>On Sunday, September 16, 2018, Nathaniel Smith <<a href="mailto:njs@pobox.com">njs@pobox.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><div class="gmail_quote"><div dir="ltr">On Wed, Sep 12, 2018, 12:29 Joni Orponen <<a href="mailto:j.orponen@4teamwork.ch" target="_blank">j.orponen@4teamwork.ch</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, Sep 12, 2018 at 8:48 PM Wes Turner <<a href="mailto:wes.turner@gmail.com" rel="noreferrer" target="_blank">wes.turner@gmail.com</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"><div>Should C extensions that compile all add</div><div>`-mindirect-branch=thunk -mindirect-branch-register` [1] to mitigate the risk of Spectre variant 2 (which does indeed affect user space applications as well as kernels)?</div></blockquote><div><br></div><div>Are those available on GCC <= 4.2.0 as per PEP 513?</div></div></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Pretty sure no manylinux1 compiler is ever going to get these mitigations.</div><div dir="auto"><br></div><div dir="auto">For manylinux2010 on x86-64, we can easily use a much newer compiler: RH maintains a recent compiler, currently gcc 7.3, or if that doesn't work for some reason then the conda folks have be apparently figured out how to build the equivalent from gcc upstream releases.</div></div></blockquote><div><br></div><div>Are there different CFLAGS and/or gcc compatibility flags in conda builds of Python and C extensions?</div><div><br></div><div>Where are those set in conda builds?</div><div><br></div><div>What's the best way to set CFLAGS in Python builds and C extensions?</div><div><br></div><div>export CFLAGS="-mindirect-branch=thunk -mindirect-branch-register"</div><div>./configure</div><div>make</div><div><br></div><div>?</div><div><br></div><div>Why are we supposed to use an old version of GCC that doesn't have the retpoline patches that only mitigate Spectre variant 2?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div dir="auto"><br></div><div dir="auto">Unfortunately, the manylinux2010 infrastructure is not quite ready... I'm pretty sure it needs some volunteers to push it to the finish line, though unfortunately I haven't had enough time to keep track.</div></div></blockquote><div><br></div><div>"PEP 571 -- The manylinux2010 Platform Tag"</div><div><a href="https://www.python.org/dev/peps/pep-0571/">https://www.python.org/dev/peps/pep-0571/</a><br></div><div><br></div><div>"Tracking issue for manylinux2010 rollout"</div><div><a href="https://github.com/pypa/manylinux/issues/179">https://github.com/pypa/manylinux/issues/179</a><br></div><div><br></div><div>Are all current Python builds and C extensions vulnerable to Spectre variants {1, 2, *}?</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>