<div dir="ltr"><div>On RAM...</div><div><br></div><div>You chose the 32-byte shadow granularity to reduce the RAM overhead,</div><div>but I am afraid this will actually increase it due to extra alignment requirements, </div><div>especially if an average allocation on your typical application is small. </div><div><br></div><div>The pointers are 32-bit, right? </div><div><div>Given how RAM-constrained your environment is, maybe you should consider something more like HWASAN instead of ASAN. </div><div><a href="https://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html">https://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html</a></div><div>But you may not have enough address bits. :(</div><div><br></div><div>--kcc </div><div><br></div><div> </div></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, May 4, 2018 at 3:10 PM Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</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>Hi Walter, </div><div><br></div>I've done a first quick scan. <br><div>Overall looks reasonable, but I'd like to try reducing the number of newly introduced platform-specific ifs. </div><div><br></div><div>Vitaly, please also take a look (once my initial comments are addressed). </div><div><br></div><div>One outstanding issue is your problem with initialization vs checking, which requires you to insert so many ifs. </div><div>Is there any chance you can avoid this? </div><div>If you control the OS, surely you can do at least minimal initialization of the shadow at a proper moment... </div><div><br></div><div>--kcc </div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, May 4, 2018 at 2:00 PM Walter Lee via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-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">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>
<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 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 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 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 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 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 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 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 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></blockquote></div>