lockdep: dovetail: fix unbalanced hard_cond_local_irq_restore
PATCH 1/1 lockdep: dovetail: fix unbalanced hard_cond_local_irq_restore
From: Jan Kiszka <[email protected]>
After the skip_checks block comes a hard_cond_local_irq_restore() - but we were not initializing flags when jumping from here.
We are in NMI context here, thus IRQs disabling is technically unneeded but a) symmetric to the hard_cond_local_irq_restore and b) truly gone when IRQ_PIPELINE is off.
---
It took backports from 7.3 down to 5.15, each reviewed by the same AI, to finally make it spot this.
kernel/locking/lockdep.c | 1 + 1 file changed, 1 insertion(+)
kernel/locking/lockdep.c +1 -0
@@ -4535,6 +4535,7 @@ void noinstr lockdep_hardirqs_on(unsigned long ip)* - hardware state check, because above; * - chain_key check, see lockdep_hardirqs_on_prepare(). */ + flags =hard_cond_local_irq_save (); goto skip_checks; }
Signature · 1 line
2.47.3
Philippe Gerum
AppliedQuoted 25 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
After the
skip_checksblock comes ahard_cond_local_irq_restore()- but we were not initializing flags when jumping from here.We are in NMI context here, thus IRQs disabling is technically unneeded but a) symmetric to the
hard_cond_local_irq_restoreand b) truly gone whenIRQ_PIPELINEis off.Reported-by OpenCode:Opus-5.5Fixes f9acdddb8afc, 5.15 ("irq_pipeline: lockdep: fix irq state causing deadlock")Signed-off-by Jan Kiszka <[email protected]>---
It took backports from 7.3 down to 5.15, each reviewed by the same AI, to finally make it spot this.
kernel/locking/lockdep.c | 1 + 1 file changed, 1 insertion(+)kernel/locking/lockdep.c +0
-0
kernel/locking/lockdep.c void noinstr lockdep_hardirqs_on(unsigned long ip) · line 4540
Quoted 6 lines
kernel/locking/lockdep.c +1
-0@@ -4535,6 +4535,7 @@ void noinstr lockdep_hardirqs_on(unsigned long ip)* - hardware state check, because above; * - chain_key check, see lockdep_hardirqs_on_prepare(). */ + flags =hard_cond_local_irq_save (); goto skip_checks; }
Merged, thanks.
Signature · 1 line
Philippe.