The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] posix-timers: fix IRQ state handling in posix_timer_delete()
@ 2026-08-25 20:06 pavankumaryalagada
  2026-08-25 21:22 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: pavankumaryalagada @ 2026-08-25 20:06 UTC (permalink / raw)
  To: anna-maria
  Cc: frederic, tglx, linux-kernel, skhan, Yalagada Pavan Kumar,
	syzbot+143e0859898751aa8f94

From: Yalagada Pavan Kumar <pavankumaryalagada@gmail.com>

exit_itimers() uses a spinlock_irq guard for timer->it_lock, which
maintains counted IRQ-disable state. However, posix_timer_delete()
temporarily releases and reacquires the lock with spin_unlock_irq()
and spin_lock_irq(), which do not maintain the same IRQ-disable state
while timer_wait_running() may sleep.

Use spin_unlock_irq_enable() and spin_lock_irq_disable() for the
temporary lock handoff to keep the IRQ-disable state balanced.

Reported-by: syzbot+143e0859898751aa8f94@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=143e0859898751aa8f94
Tested-by: syzbot+143e0859898751aa8f94@syzkaller.appspotmail.com
Signed-off-by: Yalagada Pavan Kumar <pavankumaryalagada@gmail.com>
---
 kernel/time/posix-timers.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 436ba794cc0b..5e580b4223de 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -1057,9 +1057,9 @@ static void posix_timer_delete(struct k_itimer *timer)
 
 	while (timer->kclock->timer_del(timer) == TIMER_RETRY) {
 		guard(rcu)();
-		spin_unlock_irq(&timer->it_lock);
+		spin_unlock_irq_enable(&timer->it_lock);
 		timer_wait_running(timer);
-		spin_lock_irq(&timer->it_lock);
+		spin_lock_irq_disable(&timer->it_lock);
 	}
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-25 21:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-25 20:06 [PATCH] posix-timers: fix IRQ state handling in posix_timer_delete() pavankumaryalagada
2026-08-25 21:22 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox