Skip to content

Commit f8e48a3

Browse files
author
Peter Zijlstra
committed
lockdep: Fix preemption WARN for spurious IRQ-enable
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: 4d00409 ("lockdep: Fix lockdep recursion") Reported-by: syzbot+53f8ce8bbc07924b6417@syzkaller.appspotmail.com Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
1 parent ed3e453 commit f8e48a3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

kernel/locking/lockdep.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4057,7 +4057,7 @@ void lockdep_hardirqs_on_prepare(unsigned long ip)
40574057
if (unlikely(in_nmi()))
40584058
return;
40594059

4060-
if (unlikely(__this_cpu_read(lockdep_recursion)))
4060+
if (unlikely(this_cpu_read(lockdep_recursion)))
40614061
return;
40624062

40634063
if (unlikely(lockdep_hardirqs_enabled())) {
@@ -4126,7 +4126,7 @@ void noinstr lockdep_hardirqs_on(unsigned long ip)
41264126
goto skip_checks;
41274127
}
41284128

4129-
if (unlikely(__this_cpu_read(lockdep_recursion)))
4129+
if (unlikely(this_cpu_read(lockdep_recursion)))
41304130
return;
41314131

41324132
if (lockdep_hardirqs_enabled()) {

0 commit comments

Comments
 (0)