On Tue, 2 Jun 2020 at 20:49, 'Nick Desaulniers' via kasan-dev <kasan-...@googlegroups.com> wrote: > > On Tue, Jun 2, 2020 at 11:44 AM 'Marco Elver' via Clang Built Linux > <clang-built-li...@googlegroups.com> wrote: > > > > Adds the portable definitions for __no_sanitize_address, and > > __no_sanitize_undefined, and subsequently changes noinstr to use the > > attributes to disable instrumentation via KASAN or UBSAN. > > > > Link: https://lore.kernel.org/lkml/000000000000d2474c05a6c93...@google.com/ > > Reported-by: syzbot+dc1fa714cb070b184...@syzkaller.appspotmail.com > > Signed-off-by: Marco Elver <el...@google.com> > > Currently most of our compiler attribute detection is done in > include/linux/compiler_attributes.h; I think this should be handled > there. +Miguel Ojeda
GCC and Clang define these very differently, and the way to query for them is different too. All we want is a portable __no_sanitize, and compiler-{gcc,clang}.h is the right place for that. Similar to why we define the other __no_sanitize above the places they were added. Thanks, -- Marco