cpuidle: lib/bug: Disable rcu_is_watching() during WARN/BUG
authorPeter Zijlstra <peterz@infradead.org>
Thu, 26 Jan 2023 15:08:31 +0000 (16:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:47 +0000 (09:33 +0100)
commitb78434f6eee0e6d7da3e301cfc33184a98edb08b
tree00bdefbcb51a7c2086bc70676a1c403e995d0ea4
parent463ef209628e682b65b86e1b86945f0018cb358a
cpuidle: lib/bug: Disable rcu_is_watching() during WARN/BUG

[ Upstream commit 5a5d7e9badd2cb8065db171961bd30bd3595e4b6 ]

In order to avoid WARN/BUG from generating nested or even recursive
warnings, force rcu_is_watching() true during
WARN/lockdep_rcu_suspicious().

Notably things like unwinding the stack can trigger rcu_dereference()
warnings, which then triggers more unwinding which then triggers more
warnings etc..

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20230126151323.408156109@infradead.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/context_tracking.h
kernel/locking/lockdep.c
kernel/panic.c
lib/bug.c