The 'noinstr' function attribute means no-instrumentation, this should very much include *SAN. Because lots of that is broken at present, only include KCSAN for now, as that is limited to clang11, which has sane function attribute behaviour.
Showing the changes to include/linux (1 of 1 file). Show all
Unified · Split
| @@ -118,10 +118,6 @@ struct ftrace_likely_data { · 117 unmodified lines | |||
| 118 | #define notrace __attribute__((__no_instrument_function__)) | 118 | #define notrace __attribute__((__no_instrument_function__)) |
| 119 | #endif | 119 | #endif |
| 120 | 120 | ||
| 121 | /* Section for code which can't be instrumented at all */ | ||
| 122 | #define noinstr \ | ||
| 123 | noinline notrace __attribute((__section__(".noinstr.text"))) | ||
| 124 | |||
| 125 | /* | 121 | /* |
| 126 | * it doesn't make sense on ARM (currently the only user of __naked) | 122 | * it doesn't make sense on ARM (currently the only user of __naked) |
| 127 | * to trace naked functions because then mcount is called without | 123 | * to trace naked functions because then mcount is called without |
| @@ -200,6 +196,10 @@ struct ftrace_likely_data { · 72 unmodified lines | |||
| 200 | #define __no_sanitize_or_inline __always_inline | 196 | #define __no_sanitize_or_inline __always_inline |
| 201 | #endif | 197 | #endif |
| 202 | 198 | ||
| 199 | /* Section for code which can't be instrumented at all */ | ||
| 200 | #define noinstr \ | ||
| 201 | noinline notrace __attribute((__section__(".noinstr.text"))) __no_kcsan | ||
| 202 | |||
| 203 | #endif /* __KERNEL__ */ | 203 | #endif /* __KERNEL__ */ |
| 204 | 204 | ||
| 205 | #endif /* __ASSEMBLY__ */ | 205 | #endif /* __ASSEMBLY__ */ |