<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Oct 12, 2016 at 2:03 AM, George Rimar <span dir="ltr"><<a href="mailto:grimar@accesssoftek.com" target="_blank">grimar@accesssoftek.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">grimar added a comment.<br>
<span class="m_1064408205562794820gmail-"><br>
In <a href="https://reviews.llvm.org/D25467#567497" rel="noreferrer" target="_blank">https://reviews.llvm.org/D2546<wbr>7#567497</a>, @ruiu wrote:<br>
<br>
> The new functions seem too complicated. There are a lot of ways to crash the linker by giving incorrect input. We deliberately ignore some cases such as relocations having too large values. Why do you want to fix this specifically? This is not even the only place where overflow can happen. I think we should leave it as is.<br>
<br>
<br>
</span>I am not fixing this specifically, I am trying to fix every crash or hang I see during AFL runs. There is no high or low priority for me, each crash is a problem I think.<br></blockquote><div><br></div><div>No it's not. As I mentioned and as written in the document, we don't harden the linker against all possible corrupted input files. Particularly we deliberately ignore errors (or "trust inputs") inside very hot loops. That means even if you add a lot of checks at various places, you can still crash the linker. Rigorously checking input errors at some parts of the linker and ignore errors at other places in the same linker doesn't make much sense. That's what I was trying to say in the other thread, too.</div><div><br></div><div>I'm not against showing user-friendly error messages for obvious and possible errors if doing so is easy and cheap. Notice "if" -- it needs justification and prioritization.<br></div><div><br></div><div>Honestly, printing user-friendly errors for corrupted inputs is not that high priority (even though it's a good thing to do). If you are looking for stuff to work for the linker, let's discuss. I think we have to-do items that are waiting for us to be solved.</div></div></div></div>