From b9d859fbe6aa05491683b024b2c3095e1de7676f Mon Sep 17 00:00:00 2001 From: Ryan Neph Date: Thu, 9 Sep 2021 08:48:20 -0700 Subject: [PATCH] vrend: silence false-positive use-of-uninitialized-value reported by fuzzer Fuzzer detected a Use-of-uninitialized-value in p_atomic_dec_zero(), which uses inline assembly on some platforms. MSAN's documentation claims unreliable results when instrumenting functions with inline assembly. In this case, `unsigned char c` is write-only and it's initial value isn't important, just disable MSAN for p_atomic_dec_zero(). Signed-off-by: Ryan Neph Reviewed-by: John Bates --- src/gallium/auxiliary/util/u_atomic.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/auxiliary/util/u_atomic.h b/src/gallium/auxiliary/util/u_atomic.h index 1348456..fbe936c 100644 --- a/src/gallium/auxiliary/util/u_atomic.h +++ b/src/gallium/auxiliary/util/u_atomic.h @@ -45,6 +45,7 @@ extern "C" { #define p_atomic_set(_v, _i) (*(_v) = (_i)) #define p_atomic_read(_v) (*(_v)) +__attribute__((no_sanitize("memory"))) static inline boolean p_atomic_dec_zero(int32_t *v) { @@ -92,6 +93,7 @@ extern "C" { #define p_atomic_set(_v, _i) (*(_v) = (_i)) #define p_atomic_read(_v) (*(_v)) +__attribute__((no_sanitize("memory"))) static inline boolean p_atomic_dec_zero(int32_t *v) { @@ -204,6 +206,7 @@ extern "C" { #define p_atomic_set(_v, _i) (*(_v) = (_i)) #define p_atomic_read(_v) (*(_v)) +__attribute__((no_sanitize("memory"))) static inline boolean p_atomic_dec_zero(int32_t *v) {