[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202405231647.69CAA404D8@keescook>
Date: Thu, 23 May 2024 16:49:16 -0700
From: Kees Cook <keescook@...omium.org>
To: John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>
Cc: mattst88@...il.com, linux-alpha@...r.kernel.org,
linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: Regression bisected to f2f84b05e02b (bug: consolidate
warn_slowpath_fmt() usage)
On Tue, May 21, 2024 at 08:46:52PM +0200, John Paul Adrian Glaubitz wrote:
> 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.
But how does the commit change that? It called __warn() before too.
Is this an inlining bug?
--
Kees Cook
Powered by blists - more mailing lists