diff options
author | Drew Davenport <ddavenport@chromium.org> | 2019-07-16 19:30:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-16 22:23:24 -0400 |
commit | 6b15f678fb7d5ef54e089e6ace72f007fe6e9895 (patch) | |
tree | c502620d1498eb9a23e3fc5ae1d45e41b36a7682 | |
parent | 778c1f5ccbd95722cf84d2233c6acbf4d01a3ec7 (diff) |
include/asm-generic/bug.h: fix "cut here" for WARN_ON for __WARN_TAINT architectures
For architectures using __WARN_TAINT, the WARN_ON macro did not print
out the "cut here" string. The other WARN_XXX macros would print "cut
here" inside __warn_printk, which is not called for WARN_ON since it
doesn't have a message to print.
Link: http://lkml.kernel.org/r/20190624154831.163888-1-ddavenport@chromium.org
Fixes: a7bed27af194 ("bug: fix "cut here" location for __WARN_TAINT architectures")
Signed-off-by: Drew Davenport <ddavenport@chromium.org>
Acked-by: Kees Cook <keescook@chromium.org>
Tested-by: Kees Cook <keescook@chromium.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | include/asm-generic/bug.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 0e9bd9c83870..aa6c093d9ce9 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
@@ -104,8 +104,10 @@ extern void warn_slowpath_null(const char *file, const int line); | |||
104 | warn_slowpath_fmt_taint(__FILE__, __LINE__, taint, arg) | 104 | warn_slowpath_fmt_taint(__FILE__, __LINE__, taint, arg) |
105 | #else | 105 | #else |
106 | extern __printf(1, 2) void __warn_printk(const char *fmt, ...); | 106 | extern __printf(1, 2) void __warn_printk(const char *fmt, ...); |
107 | #define __WARN() __WARN_TAINT(TAINT_WARN) | 107 | #define __WARN() do { \ |
108 | #define __WARN_printf(arg...) do { __warn_printk(arg); __WARN(); } while (0) | 108 | printk(KERN_WARNING CUT_HERE); __WARN_TAINT(TAINT_WARN); \ |
109 | } while (0) | ||
110 | #define __WARN_printf(arg...) __WARN_printf_taint(TAINT_WARN, arg) | ||
109 | #define __WARN_printf_taint(taint, arg...) \ | 111 | #define __WARN_printf_taint(taint, arg...) \ |
110 | do { __warn_printk(arg); __WARN_TAINT(taint); } while (0) | 112 | do { __warn_printk(arg); __WARN_TAINT(taint); } while (0) |
111 | #endif | 113 | #endif |