From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC1572AB21 for ; Wed, 20 Sep 2023 11:58:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A9D8C433C8; Wed, 20 Sep 2023 11:58:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1695211092; bh=sI4sKj3VTWsXHpKOFeBHh16lQ4ASbjPx1cZCFRVi2TI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=08HYxHQZAHYAFnCCCDaNEmqhXf6tSWGNOlKyD/3ZZbdxaybjJEkKPPvRPyHDJ7Uh2 TD7wovv76tXyQ6ERKM+6bo1SPMyxUwji6stj/6K1Lj3S5FwPzbPAiZBnunAPflZq3T K7VmBss4df41qXSFlrcoISAurSWDPRnt62lChngQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Lukas Wunner , Ingo Molnar , Linus Torvalds , Thomas Gleixner , "Paul E. McKenney" , Sasha Levin Subject: [PATCH 6.1 104/139] panic: Reenable preemption in WARN slowpath Date: Wed, 20 Sep 2023 13:30:38 +0200 Message-ID: <20230920112839.443577444@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230920112835.549467415@linuxfoundation.org> References: <20230920112835.549467415@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lukas Wunner [ Upstream commit cccd32816506cbac3a4c65d9dff51b3125ef1a03 ] 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 Signed-off-by: Ingo Molnar Cc: Linus Torvalds Cc: Thomas Gleixner Cc: Paul E. McKenney Link: https://lore.kernel.org/r/3ec48fde01e4ee6505f77908ba351bad200ae3d1.1694763684.git.lukas@wunner.de Signed-off-by: Sasha Levin --- kernel/panic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/panic.c b/kernel/panic.c index ca5452afb456d..63e94f3bd8dcd 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -695,6 +695,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; } -- 2.40.1