* [PATCH] tick/sched: check skew_tick kernel parameter's validity
@ 2026-08-29 20:25 Sergey Shtylyov
2026-09-01 12:55 ` Frederic Weisbecker
2026-09-29 20:01 ` Thomas Gleixner
0 siblings, 2 replies; 9+ 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] 9+ messages in thread
* Re: [PATCH] tick/sched: check skew_tick kernel parameter's validity
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
2026-09-29 20:01 ` Thomas Gleixner
1 sibling, 1 reply; 9+ messages in thread
From: Frederic Weisbecker @ 2026-09-01 12:55 UTC (permalink / raw)
To: Sergey Shtylyov
Cc: Anna-Maria Behnsen, Ingo Molnar, Thomas Gleixner, linux-kernel
Hi,
Le Sat, Aug 29, 2026 at 11:25:35PM +0300, Sergey Shtylyov a écrit :
> 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;
I'm not sure that matters. Initcall return values seem to be ignored on boot.
Looks like only modules do care.
Thanks.
> }
> --
> 2.55.0
--
Frederic Weisbecker
SUSE Labs
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] tick/sched: check skew_tick kernel parameter's validity
2026-09-01 12:55 ` Frederic Weisbecker
@ 2026-09-01 17:43 ` Sergey Shtylyov
0 siblings, 0 replies; 9+ messages in thread
From: Sergey Shtylyov @ 2026-09-01 17:43 UTC (permalink / raw)
To: Frederic Weisbecker
Cc: Anna-Maria Behnsen, Ingo Molnar, Thomas Gleixner, linux-kernel
On 9/1/26 3:55 PM, Frederic Weisbecker wrote:
[...]
>> 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;
>
> I'm not sure that matters. Initcall return values seem to be ignored on boot.
But that's not an initcall, IIUC.
Looking at do_early_param(), the kernel would call pr_warn() if the setup
fucntion fails...
> Looks like only modules do care.
[...]
MBR, Sergey
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] tick/sched: check skew_tick kernel parameter's validity
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-29 20:01 ` Thomas Gleixner
2026-09-30 19:01 ` Sergey Shtylyov
1 sibling, 1 reply; 9+ messages in thread
From: Thomas Gleixner @ 2026-09-29 20:01 UTC (permalink / raw)
To: Sergey Shtylyov, Anna-Maria Behnsen, Frederic Weisbecker,
Ingo Molnar, linux-kernel
Cc: Sergey Shtylyov
On Sat, Aug 29 2026 at 23:25, Sergey Shtylyov wrote:
> 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;
> }
sched_skew_tick should be converted to bool and this function should
simply do:
return kstrtobool(str, &sched_skew_tick);
And to make it complete, sched_skew_tick should be annotated with
ro_after_init.
Thanks,
tglx
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] tick/sched: check skew_tick kernel parameter's validity
2026-09-29 20:01 ` Thomas Gleixner
@ 2026-09-30 19:01 ` Sergey Shtylyov
2026-09-30 19:36 ` Thomas Gleixner
2026-09-30 20:04 ` Sergey Shtylyov
0 siblings, 2 replies; 9+ messages in thread
From: Sergey Shtylyov @ 2026-09-30 19:01 UTC (permalink / raw)
To: Thomas Gleixner, Anna-Maria Behnsen, Frederic Weisbecker,
Ingo Molnar, linux-kernel
On 9/29/26 11:01 PM, Thomas Gleixner wrote:
[...]>> 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;
>> }
>
> sched_skew_tick should be converted to bool and this function should
> simply do:
>
> return kstrtobool(str, &sched_skew_tick);
Thanks for your comment!
OK, I'll do that (and add the Suggested-by: tag, of/c)...
> And to make it complete, sched_skew_tick should be annotated with
> ro_after_init.
I guess you meant __ro_after_init? Would it then be OK adding it
in the same patch?
> Thanks,
>
> tglx
MBR, Sergey
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] tick/sched: check skew_tick kernel parameter's validity
2026-09-30 19:01 ` Sergey Shtylyov
@ 2026-09-30 19:36 ` Thomas Gleixner
2026-09-30 19:49 ` Sergey Shtylyov
2026-09-30 20:04 ` Sergey Shtylyov
1 sibling, 1 reply; 9+ messages in thread
From: Thomas Gleixner @ 2026-09-30 19:36 UTC (permalink / raw)
To: Sergey Shtylyov, Anna-Maria Behnsen, Frederic Weisbecker,
Ingo Molnar, linux-kernel
On Wed, Sep 30 2026 at 22:01, Sergey Shtylyov wrote:
> On 9/29/26 11:01 PM, Thomas Gleixner wrote:
> [...]>> 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;
>>> }
>>
>> sched_skew_tick should be converted to bool and this function should
>> simply do:
>>
>> return kstrtobool(str, &sched_skew_tick);
>
> Thanks for your comment!
> OK, I'll do that (and add the Suggested-by: tag, of/c)...
>
>> And to make it complete, sched_skew_tick should be annotated with
>> ro_after_init.
>
> I guess you meant __ro_after_init? Would it then be OK adding it
> in the same patch?
As you change the data type of the variable anyway that's fine. Just
mention it in the changelog.
Thanks,
tglx
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] tick/sched: check skew_tick kernel parameter's validity
2026-09-30 19:36 ` Thomas Gleixner
@ 2026-09-30 19:49 ` Sergey Shtylyov
0 siblings, 0 replies; 9+ messages in thread
From: Sergey Shtylyov @ 2026-09-30 19:49 UTC (permalink / raw)
To: Thomas Gleixner, Anna-Maria Behnsen, Frederic Weisbecker,
Ingo Molnar, linux-kernel
On 9/30/26 10:36 PM, Thomas Gleixner wrote:
[...]
>>> And to make it complete, sched_skew_tick should be annotated with
>>> ro_after_init.
>>
>> I guess you meant __ro_after_init? Would it then be OK adding it
>> in the same patch?
>
> As you change the data type of the variable anyway that's fine. Just
> mention it in the changelog.
Oh, I know the drill! :-)
> Thanks,
>
> tglx
MBR, Sergey
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] tick/sched: check skew_tick kernel parameter's validity
2026-09-30 19:01 ` Sergey Shtylyov
2026-09-30 19:36 ` Thomas Gleixner
@ 2026-09-30 20:04 ` Sergey Shtylyov
2026-09-30 22:20 ` Thomas Gleixner
1 sibling, 1 reply; 9+ messages in thread
From: Sergey Shtylyov @ 2026-09-30 20:04 UTC (permalink / raw)
To: Thomas Gleixner, Anna-Maria Behnsen, Frederic Weisbecker,
Ingo Molnar, linux-kernel
On 9/30/26 10:01 PM, Sergey Shtylyov wrote:
[...]
>>> 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;
>>> }
>>
>> sched_skew_tick should be converted to bool and this function should
>> simply do:
>>
>> return kstrtobool(str, &sched_skew_tick);
>
> Thanks for your comment!
> OK, I'll do that (and add the Suggested-by: tag, of/c)...
One thing I did forget to ask: we still don't need the Fixes tag here?
[...]
>> Thanks,
>>
>> tglx
MBR, Sergey
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] tick/sched: check skew_tick kernel parameter's validity
2026-09-30 20:04 ` Sergey Shtylyov
@ 2026-09-30 22:20 ` Thomas Gleixner
0 siblings, 0 replies; 9+ messages in thread
From: Thomas Gleixner @ 2026-09-30 22:20 UTC (permalink / raw)
To: Sergey Shtylyov, Anna-Maria Behnsen, Frederic Weisbecker,
Ingo Molnar, linux-kernel
On Wed, Sep 30 2026 at 23:04, Sergey Shtylyov wrote:
> On 9/30/26 10:01 PM, Sergey Shtylyov wrote:
>> Thanks for your comment!
>> OK, I'll do that (and add the Suggested-by: tag, of/c)...
>
> One thing I did forget to ask: we still don't need the Fixes tag here?
I have no strong opinion about it, but it's not really fixing a real
world problem aside of preventing a sysadmin to shoot himself itno the
foot. :)
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-09-30 22:20 UTC | newest]
Thread overview: 9+ 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
2026-09-29 20:01 ` Thomas Gleixner
2026-09-30 19:01 ` Sergey Shtylyov
2026-09-30 19:36 ` Thomas Gleixner
2026-09-30 19:49 ` Sergey Shtylyov
2026-09-30 20:04 ` Sergey Shtylyov
2026-09-30 22:20 ` Thomas Gleixner
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®