Re: Regression bisected to f2f84b05e02b (bug: consolidate warn_slowpath_fmt() usage)

From: John Paul Adrian Glaubitz
Date: Tue May 21 2024 - 14:47:10 EST


Hi,

Replacing the calls to raw_smp_processor_id() in __warn() with just "0" fixes the problem for me:

diff --git a/kernel/panic.c b/kernel/panic.c
index 8bff183d6180..12f6cea6b8b0 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -671,11 +671,11 @@ void __warn(const char *file, int line, void *caller, unsigned taint,

if (file)
pr_warn("WARNING: CPU: %d PID: %d at %s:%d %pS\n",
- raw_smp_processor_id(), current->pid, file, line,
+ 0, current->pid, file, line,
caller);
else
pr_warn("WARNING: CPU: %d PID: %d at %pS\n",
- raw_smp_processor_id(), current->pid, caller);
+ 0, current->pid, caller);

#pragma GCC diagnostic push
#ifndef __clang__

So, I assume the problem is that SMP support is not fully initialized at this
point yet such that raw_smp_processor_id() causes the zero pointer dereference.

Adrian

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913