aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2022-08-26 17:07:31 +0200
committerMarco Elver <elver@google.com>2022-08-29 14:15:34 +0200
commitce5979e029b3d9c3ebbf8ef4cc881e933f6528af (patch)
tree8203faa319d4ad45b4b96cce74bc75deb5f3f603
parentfc737b10e27268bbd7097cf9bfe6b7442a58d344 (diff)
downloadlinux-ce5979e029b3d9c3ebbf8ef4cc881e933f6528af.tar.gz
kmsan: mark noinstr as __no_sanitize_memory
noinstr functions should never be instrumented, so make KMSAN skip them by applying the __no_sanitize_memory attribute. Signed-off-by: Alexander Potapenko <glider@google.com> Reviewed-by: Marco Elver <elver@google.com> Signed-off-by: Marco Elver <elver@google.com>
-rw-r--r--include/linux/compiler_types.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index 4f2a819fd60a34..015207a6e2bf52 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -229,7 +229,8 @@ struct ftrace_likely_data {
/* Section for code which can't be instrumented at all */
#define noinstr \
noinline notrace __attribute((__section__(".noinstr.text"))) \
- __no_kcsan __no_sanitize_address __no_profile __no_sanitize_coverage
+ __no_kcsan __no_sanitize_address __no_profile __no_sanitize_coverage \
+ __no_sanitize_memory
#endif /* __KERNEL__ */