This is a note to let you know that I've just added the patch titled lockdep: Fix preemption WARN for spurious IRQ-enable to the 5.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: lockdep-fix-preemption-warn-for-spurious-irq-enable.patch and it can be found in the queue-5.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 3caf638ca9f4c8e5ca1dfb7f96090c5adb42a82e Author: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Date: Thu Oct 22 12:23:02 2020 +0200 lockdep: Fix preemption WARN for spurious IRQ-enable [ Upstream commit f8e48a3dca060e80f672d398d181db1298fbc86c ] It is valid (albeit uncommon) to call local_irq_enable() without first having called local_irq_disable(). In this case we enter lockdep_hardirqs_on*() with IRQs enabled and trip a preemption warning for using __this_cpu_read(). Use this_cpu_read() instead to avoid the warning. Fixes: 4d004099a6 ("lockdep: Fix lockdep recursion") Reported-by: syzbot+53f8ce8bbc07924b6417@xxxxxxxxxxxxxxxxxxxxxxxxx Reported-by: kernel test robot <lkp@xxxxxxxxx> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 85d15f0362dc5..3eb35ad1b5241 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -3681,7 +3681,7 @@ void lockdep_hardirqs_on_prepare(unsigned long ip) if (unlikely(in_nmi())) return; - if (unlikely(__this_cpu_read(lockdep_recursion))) + if (unlikely(this_cpu_read(lockdep_recursion))) return; if (unlikely(lockdep_hardirqs_enabled())) { @@ -3750,7 +3750,7 @@ void noinstr lockdep_hardirqs_on(unsigned long ip) goto skip_checks; } - if (unlikely(__this_cpu_read(lockdep_recursion))) + if (unlikely(this_cpu_read(lockdep_recursion))) return; if (lockdep_hardirqs_enabled()) {