<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, May 4, 2018 at 6:29 PM Walter Lee <<a href="mailto:waltl@google.com">waltl@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Kostya.  Thanks for the quick feedback.  I will work on addressing your<br>
comments.<br>
<br>
In regard to initialization checks, I can eliminate most of them by<br>
initializing the shadow memory very early, </blockquote><div><br></div><div>This will be a very good way to handle this. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">but I still need to do something<br>
in two places, __asan_handle_no_return </blockquote><div><br></div><div>I think it might be fine. Let me look at the code once the rest is done. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">and GetFakeStackFast.  </blockquote><div><br></div><div>Not sure. Why don't just disable stack-use-after-return? </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Would it be<br>
ok to have guards for those two places only?<br>
<br>
Walter<br>
On Fri, May 4, 2018 at 6:10 PM Kostya Serebryany <<a href="mailto:kcc@google.com" target="_blank">kcc@google.com</a>> wrote:<br>
<br>
> Hi Walter,<br>
<br>
> I've done a first quick scan.<br>
> Overall looks reasonable, but I'd like to try reducing the number of<br>
newly introduced platform-specific ifs.<br>
<br>
> Vitaly, please also take a look (once my initial comments are addressed).<br>
<br>
> One outstanding issue is your problem with initialization vs checking,<br>
which requires you to insert so many ifs.<br>
> Is there any chance you can avoid this?<br>
> If you control the OS, surely you can do at least minimal initialization<br>
of the shadow at a proper moment...<br>
<br>
> --kcc<br>
<br>
> On Fri, May 4, 2018 at 2:00 PM Walter Lee via llvm-dev <<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
<br>
>> I have ported ASan in LLVM to Myriad RTEMS, and I would like to<br>
>> upstream the port.  Below is the design doc.  Feedback welcome.<br>
<br>
<br>
<a href="https://docs.google.com/document/d/1oxmk0xUojybDaQDAuTEVpHVMi5xQX74cJPyMJbaSaRM" rel="noreferrer" target="_blank">https://docs.google.com/document/d/1oxmk0xUojybDaQDAuTEVpHVMi5xQX74cJPyMJbaSaRM</a><br>
<br>
>> The port is expected to work with modified versions of RTEMS and<br>
>> newlib.  I have a git repo with changes to those projects, that I can<br>
>> make available if there is interest.<br>
<br>
>> Here is the patch series:<br>
>> <a href="https://reviews.llvm.org/D46451" rel="noreferrer" target="_blank">https://reviews.llvm.org/D46451</a> [asan] Add instrumentation support for<br>
>> Myriad<br>
>> <a href="https://reviews.llvm.org/D46452" rel="noreferrer" target="_blank">https://reviews.llvm.org/D46452</a> [sanitizer] Don't add --export-dynamic<br>
for<br>
>> Myriad<br>
>> <a href="https://reviews.llvm.org/D46453" rel="noreferrer" target="_blank">https://reviews.llvm.org/D46453</a> [sanitizer] Add definitions for Myriad<br>
>> RTEMS platform<br>
>> <a href="https://reviews.llvm.org/D46454" rel="noreferrer" target="_blank">https://reviews.llvm.org/D46454</a> [sanitizer] Trivial portion of the port<br>
to<br>
>> Myriad RTEMS<br>
>> <a href="https://reviews.llvm.org/D46456" rel="noreferrer" target="_blank">https://reviews.llvm.org/D46456</a> [asan] Add support for Myriad RTEMS<br>
memory<br>
>> map<br>
>> <a href="https://reviews.llvm.org/D46457" rel="noreferrer" target="_blank">https://reviews.llvm.org/D46457</a> [asan] Add a magic shadow value for shadw<br>
>> gap<br>
>> <a href="https://reviews.llvm.org/D46459" rel="noreferrer" target="_blank">https://reviews.llvm.org/D46459</a> [asan] On RTEMS, checks for asan_inited<br>
>> before entering ASan run-time<br>
>> <a href="https://reviews.llvm.org/D46461" rel="noreferrer" target="_blank">https://reviews.llvm.org/D46461</a> [asan] Set flags appropriately for RTEMS<br>
>> <a href="https://reviews.llvm.org/D46462" rel="noreferrer" target="_blank">https://reviews.llvm.org/D46462</a> [sanitizer] Allow Fuchsia symbolizer to<br>
be<br>
>> reused by Myriad RTEMS<br>
>> <a href="https://reviews.llvm.org/D46463" rel="noreferrer" target="_blank">https://reviews.llvm.org/D46463</a> [sanitizer] On RTEMS, avoid recursion<br>
when<br>
>> reporting Mmap failure<br>
>> <a href="https://reviews.llvm.org/D46465" rel="noreferrer" target="_blank">https://reviews.llvm.org/D46465</a> [asan] Port asan_malloc_linux.cc to RTEMS<br>
>> <a href="https://reviews.llvm.org/D46466" rel="noreferrer" target="_blank">https://reviews.llvm.org/D46466</a> [asan] Add AsanThread::Restart() to<br>
support<br>
>> thread restart<br>
>> <a href="https://reviews.llvm.org/D46467" rel="noreferrer" target="_blank">https://reviews.llvm.org/D46467</a> [asan] Add argument to allow fake stack<br>
to<br>
>> be initialized during thread init<br>
>> <a href="https://reviews.llvm.org/D46468" rel="noreferrer" target="_blank">https://reviews.llvm.org/D46468</a> [asan] Add target-specific files for<br>
Myriad<br>
>> RTEMS port<br>
>> <a href="https://reviews.llvm.org/D46469" rel="noreferrer" target="_blank">https://reviews.llvm.org/D46469</a> [sanitizer] Port fast stack unwinder to<br>
>> sparcv8<br>
<br>
>> Thanks,<br>
<br>
>> Walter<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>
</blockquote></div></div>