[PATCH] D76665: [asan] Stop instrumenting NetBSD-specific link_set sections

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 2 05:31:24 PDT 2020


krytarowski added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:1859
+    // array elements
+    if (Section.startswith("link_set")) {
+      LLVM_DEBUG(dbgs() << "Ignoring global in sorted section "
----------------
mgorny wrote:
> pcc wrote:
> > What do the names of these sections look like? From the test I presume that they have C identifier names and are enumerated via `__start_`/`__stop_`. In that case we should exclude all C identifier named sections from instrumentation (not just `link_set*`) in order to fix similar bugs involving those sections.
> They are created via the following macro:
> 
> ```
> #define	__link_set_make_entry(set, sym)					\
> 	static void const * const __link_set_##set##_sym_##sym		\
> 	    __section("link_set_" #set) __used = (const void *)&sym
> ```
> 
> So the `link_set_` name is enforced on our end. Of course, people can do any crazy things they like, so can't tell if anyone else has a similar use case.
@pcc can you suggest how to implement a generalized version of this patch that disables instrumentation of user-defined sections?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76665/new/

https://reviews.llvm.org/D76665





More information about the llvm-commits mailing list