The patch titled Subject: bug: lift "cut here" out of __warn() has been added to the -mm tree. Its filename is bug-lift-cut-here-out-of-__warn.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/bug-lift-cut-here-out-of-__warn.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/bug-lift-cut-here-out-of-__warn.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Kees Cook <keescook@xxxxxxxxxxxx> Subject: bug: lift "cut here" out of __warn() In preparation for cleaning up "cut here", move the "cut here" logic up out of __warn() and into callers that pass non-NULL args. For anyone looking closely, there are two callers that pass NULL args: one already explicitly prints "cut here". The remaining case is covered by how a WARN is built, which will be cleaned up in the next patch. Link: http://lkml.kernel.org/r/20190819234111.9019-5-keescook@xxxxxxxxxxxx Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx> Cc: Arnd Bergmann <arnd@xxxxxxxx> Cc: Borislav Petkov <bp@xxxxxxx> Cc: Christophe Leroy <christophe.leroy@xxxxxx> Cc: Drew Davenport <ddavenport@xxxxxxxxxxxx> Cc: Feng Tang <feng.tang@xxxxxxxxx> Cc: Mauro Carvalho Chehab <mchehab+samsung@xxxxxxxxxx> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Cc: Petr Mladek <pmladek@xxxxxxxx> Cc: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx> Cc: YueHaibing <yuehaibing@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/panic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/kernel/panic.c~bug-lift-cut-here-out-of-__warn +++ a/kernel/panic.c @@ -559,9 +559,6 @@ void __warn(const char *file, int line, { disable_trace_on_warning(); - if (args) - pr_warn(CUT_HERE); - if (file) pr_warn("WARNING: CPU: %d PID: %d at %s:%d %pS\n", raw_smp_processor_id(), current->pid, file, line, @@ -605,8 +602,9 @@ void warn_slowpath_fmt(const char *file, { struct warn_args args; + pr_warn(CUT_HERE); + if (!fmt) { - pr_warn(CUT_HERE); __warn(file, line, __builtin_return_address(0), taint, NULL, NULL); return; _ Patches currently in -mm which might be from keescook@xxxxxxxxxxxx are strscpy-reject-buffer-sizes-larger-than-int_max.patch bug-refactor-away-warn_slowpath_fmt_taint.patch bug-rename-__warn_printf_taint-to-__warn_printf.patch bug-consolidate-warn_slowpath_fmt-usage.patch bug-lift-cut-here-out-of-__warn.patch bug-clean-up-helper-macros-to-remove-__warn_taint.patch bug-consolidate-__warn_flags-usage.patch bug-move-warn_on-cut-here-into-exception-handler.patch