All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hrtimer: Fix missing debug object calls in in-place update path
@ 2026-06-19 13:13 Surya Sai Madhu
  2026-06-19 19:12 ` Thomas Gleixner
  0 siblings, 1 reply; 6+ messages in thread
From: Surya Sai Madhu @ 2026-06-19 13:13 UTC (permalink / raw)
  To: tglx
  Cc: anna-maria, frederic, peterz, mingo, linux-kernel,
	Surya Sai Madhu, syzbot+5e8dda76ca21dae314b6

Commit 343f2f4dc542 ("hrtimer: Try to modify timers in place")
introduced an optimization that updates the timer expiry in-place
without dequeuing and re-enqueuing it when the new expiry falls
within the range of neighbouring timers.

However, the in-place path skips debug_hrtimer_deactivate() and
debug_hrtimer_activate() calls, leaving the ODEBUG state machine
out of sync. When ODEBUG subsequently sees the timer in an
unexpected state, hrtimer_fixup_assert_init() fires and installs
stub_timer() as the callback. When the timer then expires,
stub_timer() hits WARN_ON(1) causing a kernel panic.

Fix this by adding the missing debug object deactivate/activate
calls in the in-place update path.

Reported-by: syzbot+5e8dda76ca21dae314b6@syzkaller.appspotmail.com
Fixes: 343f2f4dc542 ("hrtimer: Try to modify timers in place")
Signed-off-by: suryasaimadhu <suryasaimadhu369@gmail.com>
---
Note: Please consider this submission. Previous sends had email
configuration issues and were sent from the wrong address.

 kernel/time/hrtimer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 638ce623c342..f60f109a299a 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1243,6 +1243,8 @@ remove_and_enqueue_same_base(struct hrtimer *timer, struct hrtimer_clock_base *b
 		/* Try to update in place to avoid the de/enqueue dance */
 		if (hrtimer_can_update_in_place(timer, base, expires)) {
 			hrtimer_set_expires_range_ns(timer, expires, delta_ns);
+			debug_hrtimer_deactivate(timer);
+			debug_hrtimer_activate(timer, mode);
 			trace_hrtimer_start(timer, mode, true);
 			if (was_first)
 				base->expires_next = expires;
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH] hrtimer: Fix missing debug object calls in in-place update path
@ 2026-06-19 13:10 suryasaimadhu
  0 siblings, 0 replies; 6+ messages in thread
From: suryasaimadhu @ 2026-06-19 13:10 UTC (permalink / raw)
  To: tglx
  Cc: anna-maria, frederic, peterz, mingo, linux-kernel,
	Surya Sai Madhu, syzbot+5e8dda76ca21dae314b6

From: Surya Sai Madhu <suryasaimadhu369@gmail.com>

Commit 343f2f4dc542 ("hrtimer: Try to modify timers in place")
introduced an optimization that updates the timer expiry in-place
without dequeuing and re-enqueuing it when the new expiry falls
within the range of neighbouring timers.

However, the in-place path skips debug_hrtimer_deactivate() and
debug_hrtimer_activate() calls, leaving the ODEBUG state machine
out of sync. When ODEBUG subsequently sees the timer in an
unexpected state, hrtimer_fixup_assert_init() fires and installs
stub_timer() as the callback. When the timer then expires,
stub_timer() hits WARN_ON(1) causing a kernel panic.

Fix this by adding the missing debug object deactivate/activate
calls in the in-place update path.

Reported-by: syzbot+5e8dda76ca21dae314b6@syzkaller.appspotmail.com
Fixes: 343f2f4dc542 ("hrtimer: Try to modify timers in place")
Signed-off-by: suryasaimadhu <suryasaimadhu369@gmail.com>
---
Note: Please consider this submission. Previous sends had email
configuration issues and were sent from the wrong address.

 kernel/time/hrtimer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 638ce623c342..f60f109a299a 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1243,6 +1243,8 @@ remove_and_enqueue_same_base(struct hrtimer *timer, struct hrtimer_clock_base *b
 		/* Try to update in place to avoid the de/enqueue dance */
 		if (hrtimer_can_update_in_place(timer, base, expires)) {
 			hrtimer_set_expires_range_ns(timer, expires, delta_ns);
+			debug_hrtimer_deactivate(timer);
+			debug_hrtimer_activate(timer, mode);
 			trace_hrtimer_start(timer, mode, true);
 			if (was_first)
 				base->expires_next = expires;
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH] hrtimer: Fix missing debug object calls in in-place update path
@ 2026-06-19 13:01 suryasaimadhu
  0 siblings, 0 replies; 6+ messages in thread
From: suryasaimadhu @ 2026-06-19 13:01 UTC (permalink / raw)
  To: tglx
  Cc: anna-maria, frederic, peterz, mingo, linux-kernel,
	Surya Sai Madhu, syzbot+5e8dda76ca21dae314b6, suryasaimadhu

From: Surya Sai Madhu <suryasaimadhu369@gmail.com>

Commit 343f2f4dc542 ("hrtimer: Try to modify timers in place")
introduced an optimization that updates the timer expiry in-place
without dequeuing and re-enqueuing it when the new expiry falls
within the range of neighbouring timers.

However, the in-place path skips debug_hrtimer_deactivate() and
debug_hrtimer_activate() calls, leaving the ODEBUG state machine
out of sync. When ODEBUG subsequently sees the timer in an
unexpected state, hrtimer_fixup_assert_init() fires and installs
stub_timer() as the callback. When the timer then expires,
stub_timer() hits WARN_ON(1) causing a kernel panic.

Fix this by adding the missing debug object deactivate/activate
calls in the in-place update path.

Reported-by: syzbot+5e8dda76ca21dae314b6@syzkaller.appspotmail.com
Fixes: 343f2f4dc542 ("hrtimer: Try to modify timers in place")
Signed-off-by: suryasaimadhu <SaiMadhu.KoyyalaHariVenkata@amd.com>
---
 kernel/time/hrtimer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 638ce623c342..f60f109a299a 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1243,6 +1243,8 @@ remove_and_enqueue_same_base(struct hrtimer *timer, struct hrtimer_clock_base *b
 		/* Try to update in place to avoid the de/enqueue dance */
 		if (hrtimer_can_update_in_place(timer, base, expires)) {
 			hrtimer_set_expires_range_ns(timer, expires, delta_ns);
+			debug_hrtimer_deactivate(timer);
+			debug_hrtimer_activate(timer, mode);
 			trace_hrtimer_start(timer, mode, true);
 			if (was_first)
 				base->expires_next = expires;
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH] hrtimer: Fix missing debug object calls in in-place update path
@ 2026-06-19 12:59 suryasaimadhu
  0 siblings, 0 replies; 6+ messages in thread
From: suryasaimadhu @ 2026-06-19 12:59 UTC (permalink / raw)
  To: tglx
  Cc: anna-maria, frederic, peterz, mingo, linux-kernel,
	Surya Sai Madhu, syzbot+5e8dda76ca21dae314b6, suryasaimadhu

From: Surya Sai Madhu <suryasaimadhu369@gmail.com>

Commit 343f2f4dc542 ("hrtimer: Try to modify timers in place")
introduced an optimization that updates the timer expiry in-place
without dequeuing and re-enqueuing it when the new expiry falls
within the range of neighbouring timers.

However, the in-place path skips debug_hrtimer_deactivate() and
debug_hrtimer_activate() calls, leaving the ODEBUG state machine
out of sync. When ODEBUG subsequently sees the timer in an
unexpected state, hrtimer_fixup_assert_init() fires and installs
stub_timer() as the callback. When the timer then expires,
stub_timer() hits WARN_ON(1) causing a kernel panic.

Fix this by adding the missing debug object deactivate/activate
calls in the in-place update path.

Reported-by: syzbot+5e8dda76ca21dae314b6@syzkaller.appspotmail.com
Fixes: 343f2f4dc542 ("hrtimer: Try to modify timers in place")
Signed-off-by: suryasaimadhu <SaiMadhu.KoyyalaHariVenkata@amd.com>
---
 kernel/time/hrtimer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 638ce623c342..f60f109a299a 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1243,6 +1243,8 @@ remove_and_enqueue_same_base(struct hrtimer *timer, struct hrtimer_clock_base *b
 		/* Try to update in place to avoid the de/enqueue dance */
 		if (hrtimer_can_update_in_place(timer, base, expires)) {
 			hrtimer_set_expires_range_ns(timer, expires, delta_ns);
+			debug_hrtimer_deactivate(timer);
+			debug_hrtimer_activate(timer, mode);
 			trace_hrtimer_start(timer, mode, true);
 			if (was_first)
 				base->expires_next = expires;
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH] hrtimer: Fix missing debug object calls in in-place update path
@ 2026-06-19 12:57 suryasaimadhu
  0 siblings, 0 replies; 6+ messages in thread
From: suryasaimadhu @ 2026-06-19 12:57 UTC (permalink / raw)
  To: tglx
  Cc: anna-maria, frederic, peterz, mingo, linux-kernel, suryasaimadhu,
	syzbot+5e8dda76ca21dae314b6, suryasaimadhu

From: suryasaimadhu <suryasaimadhu369@gmail.com>

Commit 343f2f4dc542 ("hrtimer: Try to modify timers in place")
introduced an optimization that updates the timer expiry in-place
without dequeuing and re-enqueuing it when the new expiry falls
within the range of neighbouring timers.

However, the in-place path skips debug_hrtimer_deactivate() and
debug_hrtimer_activate() calls, leaving the ODEBUG state machine
out of sync. When ODEBUG subsequently sees the timer in an
unexpected state, hrtimer_fixup_assert_init() fires and installs
stub_timer() as the callback. When the timer then expires,
stub_timer() hits WARN_ON(1) causing a kernel panic.

Fix this by adding the missing debug object deactivate/activate
calls in the in-place update path.

Reported-by: syzbot+5e8dda76ca21dae314b6@syzkaller.appspotmail.com
Fixes: 343f2f4dc542 ("hrtimer: Try to modify timers in place")
Signed-off-by: suryasaimadhu <SaiMadhu.KoyyalaHariVenkata@amd.com>
---
 kernel/time/hrtimer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 638ce623c342..f60f109a299a 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1243,6 +1243,8 @@ remove_and_enqueue_same_base(struct hrtimer *timer, struct hrtimer_clock_base *b
 		/* Try to update in place to avoid the de/enqueue dance */
 		if (hrtimer_can_update_in_place(timer, base, expires)) {
 			hrtimer_set_expires_range_ns(timer, expires, delta_ns);
+			debug_hrtimer_deactivate(timer);
+			debug_hrtimer_activate(timer, mode);
 			trace_hrtimer_start(timer, mode, true);
 			if (was_first)
 				base->expires_next = expires;
-- 
2.47.3


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

end of thread, other threads:[~2026-06-19 19:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-19 13:13 [PATCH] hrtimer: Fix missing debug object calls in in-place update path Surya Sai Madhu
2026-06-19 19:12 ` Thomas Gleixner
  -- strict thread matches above, loose matches on Subject: below --
2026-06-19 13:10 suryasaimadhu
2026-06-19 13:01 suryasaimadhu
2026-06-19 12:59 suryasaimadhu
2026-06-19 12:57 suryasaimadhu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.