<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Mar 22, 2016 at 9:19 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Tue, Mar 22, 2016 at 1:15 PM, Rui Ueyama <span dir="ltr"><<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Tue, Mar 22, 2016 at 9:00 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Tue, Mar 22, 2016 at 12:36 PM, Rui Ueyama <span dir="ltr"><<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Tue, Mar 22, 2016 at 7:36 PM, Rui Ueyama <span dir="ltr"><<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have a question. If there is a ELF verifier function that walks every part of an ELF file to verify that the file is sane, and if you can call that before calling LLD's function, are you guys happy with that?</div></blockquote><div><br></div></span><div>I'd like to get you guys opinion on this question.</div></div></div></div></blockquote><div><br></div></span><div>I'd still find it problematic that lld itself would consider crash-on-invalid "not a bug" to the point of not reviewing/approving patches to fix such issues. That's what I'm concerned about in this thread.</div></div></div></div></blockquote><div><br></div></span><div>That's one way to see that. The other view is it as a whole has a boolean option <i>IsInputTrustworthy</i> and works accordingly. What matters most is what we provide to the users as a guarantee.  You have an opinion that that should be implemented within LLD, but that would now an internal design choice. Hypothetically we had such pass to verify inputs, and if you send a patch to "fix" crash bug of LLD, we wouldn't probably reject that but instead argue that that needs to be addressed in the verifier pass instead. This is about "how" something should be implemented and usual design choice discussion, no?</div></div></div></div></blockquote><div><br></div></span><div>OK, sorry - some confusion. I assume that you wouldn't run this verifier pass by default in lld-the-command-line-tool, right? (I would guess it wouldn't meet your performance criteria)<br></div></div></div></div></blockquote><div><br></div><div>Correct.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>So from that perspective, lld-the-command-line-tool would still be crashing-by-design on certain inputs in its default/normal/user-facing mode & that would be seem problematic to me.<br></div></div></div></div></blockquote><div><br></div><div>I disagree. You are in almost all case handling valid object files created by compilers, and if omitting some error checks for really pathetic case would make code simpler and improve performance, I think having that option is worth it (and I believe that's the case, at least those who are actually writing code seems to take that stance.) Also, if you give broken object files, you wouldn't get an output anyways. The only difference that a user can observe is whether it dies with an error message or not. We could even catch an segfault and run the verifier on the input again to print out an error after something goes wrong.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>If you're proposing having this verifier run by default - sure, then I can't construct an input that crashes the linker, it'll fail with an error message an exit. Yes, that would be fine by me - the way the feature is implemented is not something I mean to imply constraints on.<span><font color="#888888"><br><br>- David</font></span></div><div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div class="gmail_extra"><div class="gmail_quote">On Tue, Mar 22, 2016 at 6:39 PM, Hal Finkel via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000"><br><hr><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><b>From: </b>"David Blaikie via llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br><b>To: </b>"Rafael Espíndola" <<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>><span><br><b>Cc: </b>"llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>, "Bruce Hoult" <<a href="mailto:bruce@hoult.org" target="_blank">bruce@hoult.org</a>><br></span><b>Sent: </b>Tuesday, March 22, 2016 10:18:03 AM<span><br><b>Subject: </b>Re: [llvm-dev] Need help with code generation<br><br></span><div dir="ltr"><br><div class="gmail_extra"><br><span><div class="gmail_quote">On Tue, Mar 22, 2016 at 4:27 AM, Rafael Espíndola <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>> Maybe not, but it's not impossible either - browsers manage to harden themselves against malicious input and they operate in a far hostile environment with many more input formats than we do.<br>
<br>
</span>It is important to note how different they are. Both Firefox and<br>
Chromium have people working just to try to make them more secure.<br>
Compare that with LLVM: One week ago I pointed out that your patch<br>
(r263521) introduces a crash. It still hasn't been reverted or even<br>
acknowledge yet.<br>
<span><br>
<br>
> I'm not trying to shift your personal goal, or to direct the features that you choose to put your time into, but I am interested in project policy.<br>
<br>
</span>Why do you care about policy that is not followed? A policy saying<br>
llvm should not crash on any input is as relevant as one that says<br>
that clang should keep bootstrapping in under one second.<br></blockquote><div><br></div><div>It's pretty different when you say, essentially, that patches to address these things are unlikely to be accepted. It doesn't seem surprising that people wouldn't try to provide those patches and would choose not to use the project if that's the expressed policy of the developers on the project and doesn't line up with the needs of other people.</div></div></span></div></div></blockquote><br>+1<br><br> -Hal<span><br><br><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
So, if we stick to reality, what we have is that lld (ELF and COFF)<br>
are already the most reliable parts of the toolchain. If not for Rui<br>
and I being upfront about it most people would not even know that you<br>
could crash it. So please, just let us keep working on the most<br>
reliable part of the toolchain.<br>
<div><div><br>
Cheers,<br>
Rafael<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div></div>
<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br></blockquote><br><br><br></span><span>-- <br><div><span name="x"></span>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory<span name="x"></span><br></div></span></div></div><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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div></div></div><br></div></div>
</blockquote></div></div></div><br></div></div>
</blockquote></div></div></div><br></div></div>
</blockquote></div></div></div><br></div></div>
</blockquote></div><br></div></div>