[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230915093855.GB6743@noisy.programming.kicks-ass.net>
Date: Fri, 15 Sep 2023 11:38:55 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Lukas Wunner <lukas@...ner.de>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] panic: Reenable preemption in WARN slowpath
On Fri, Sep 15, 2023 at 09:55:39AM +0200, Lukas Wunner wrote:
> Commit 5a5d7e9badd2 ("cpuidle: lib/bug: Disable rcu_is_watching() during
> WARN/BUG") amended warn_slowpath_fmt() to disable preemption until the
> WARN splat has been emitted.
>
> However the commit neglected to reenable preemption in the !fmt codepath,
> i.e. when a WARN splat is emitted without additional format string.
>
> One consequence is that users may see more splats than intended. E.g. a
> WARN splat emitted in a work item results in at least two extra splats:
>
> BUG: workqueue leaked lock or atomic
> (emitted by process_one_work())
>
> BUG: scheduling while atomic
> (emitted by worker_thread() -> schedule())
>
> Ironically the point of the commit was to *avoid* extra splats. ;)
>
> Fix it.
>
> Fixes: 5a5d7e9badd2 ("cpuidle: lib/bug: Disable rcu_is_watching() during WARN/BUG")
> Signed-off-by: Lukas Wunner <lukas@...ner.de>
> Cc: stable@...r.kernel.org # v6.1+
> Cc: Peter Zijlstra <peterz@...radead.org>
> ---
> The original commit went in through the tip tree, hence submitting to
> tip maintainers. The commit was backported to v6.1-stable (even though
> it wasn't tagged for stable), hence this fix needs a stable designation.
>
> kernel/panic.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/panic.c b/kernel/panic.c
> index 07239d4..ffa037fa 100644
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -697,6 +697,7 @@ void warn_slowpath_fmt(const char *file, int line, unsigned taint,
> if (!fmt) {
> __warn(file, line, __builtin_return_address(0), taint,
> NULL, NULL);
> + warn_rcu_exit(rcu);
> return;
> }
Urgh, thanks!
Powered by blists - more mailing lists