public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/107963] New: Support __attribute__((disable_sanitizer_instrumentation))
@ 2022-12-04  6:38 i at maskray dot me
  2022-12-04  6:45 ` [Bug sanitizer/107963] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: i at maskray dot me @ 2022-12-04  6:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107963

            Bug ID: 107963
           Summary: Support
                    __attribute__((disable_sanitizer_instrumentation))
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: i at maskray dot me
  Target Milestone: ---

Clang introduced the attribute in https://reviews.llvm.org/D108029 (2021-08).
It disables instrumentations for all kinds of sanitizers.
For non-memory sanitizers, it's like the union of all available
no_sanitize("xxx").
For msan, it disables all instrumentations, therefore the following function
does not unpoison the shadow for *a, which may lead to a false positive for a
subsequent function
(https://clang.llvm.org/docs/MemorySanitizer.html#attribute-disable-sanitizer-instrumentation).
That said, such functionality is useful in some scenarios, e.g. `noinstr` in
the Linux kernel
(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9b448bc25b776daab3215393c3ce6953dd3bb8ad)

__attribute__((disable_sanitizer_instrumentation)) int foo(int *a) {
  *a = 42;
  return *a;
}

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-12-05  8:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-04  6:38 [Bug c/107963] New: Support __attribute__((disable_sanitizer_instrumentation)) i at maskray dot me
2022-12-04  6:45 ` [Bug sanitizer/107963] " pinskia at gcc dot gnu.org
2022-12-04 21:50 ` sam at gentoo dot org
2022-12-04 23:24 ` i at maskray dot me
2022-12-05  0:01 ` pinskia at gcc dot gnu.org
2022-12-05  8:18 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).