mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] tick/sched: check skew_tick kernel parameter's validity
@ 2026-08-29 20:25 Sergey Shtylyov
  2026-09-01 12:55 ` Frederic Weisbecker
  0 siblings, 1 reply; 3+ messages in thread
From: Sergey Shtylyov @ 2026-08-29 20:25 UTC (permalink / raw)
  To: Anna-Maria Behnsen, Frederic Weisbecker, Ingo Molnar,
	Thomas Gleixner, linux-kernel
  Cc: Sergey Shtylyov

In skew_tick(), the result of get_option() call is ignored, so even if a
value of the skew_tick kernel parameter was not specified (or specified
as a list or range), the kernel won't complain. Add the missing check...

Found by Linux Verification Center (linuxtesting.org) with the Svace static
analysis tool.

Signed-off-by: Sergey Shtylyov <s.shtylyov@auroraos.dev>

---
The patch is against the timers/nohz branch of the tip.git repo...

 kernel/time/tick-sched.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index c1ee0b256445..34ceccdd49b5 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -1483,7 +1483,8 @@ static int sched_skew_tick;
 
 static int __init skew_tick(char *str)
 {
-	get_option(&str, &sched_skew_tick);
+	if (get_option(&str, &sched_skew_tick) != 1)
+		return -EINVAL;
 
 	return 0;
 }
-- 
2.55.0

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

end of thread, other threads:[~2026-09-01 17:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-29 20:25 [PATCH] tick/sched: check skew_tick kernel parameter's validity Sergey Shtylyov
2026-09-01 12:55 ` Frederic Weisbecker
2026-09-01 17:43   ` Sergey Shtylyov

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

all inboxes | Powered by JetHome®