sched/isolation: avoid reading past string in isolcpus parser
PATCH v2 1/1 sched/isolation: avoid reading past string in isolcpus parser
The function housekeeping_isolcpus_setup() advanced the parser pointer unconditionally after unknown flags.
For an argument like 'isolcpus=unknownflag', with no trailing comma, this can move the pointer past the terminating NUL, and the next loop test reads out of bounds.
Reproducer:
isolcpus=unknownflag
Advance only when the parser is not already at the terminating NUL, preserving existing parsing semantics while avoiding the invalid read.
---
v2:
- Advance past any non-NUL separator instead of checking specifically for ','.
kernel/sched/isolation.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/sched/isolation.c +2 -1
@@ -355,7 +355,8 @@ static int __init housekeeping_isolcpus_setup(char *str) }pr_info ("isolcpus: Skipped unknown flag %.*s\n" , len, par); - str++; +if (*str) + str++; }/* Default behaviour for isolcpus without flags */
Signature · 1 line
2.47.3
Quoted 10 lines · On Mon, 9 Mar 2026 18:02:16 -0400 Joseph Salisbury…
The function
housekeeping_isolcpus_setup()advanced the parser pointer unconditionally after unknown flags.For an argument like 'isolcpus=unknownflag', with no trailing comma, this can move the pointer past the terminating NUL, and the next loop test reads out of bounds.
Reproducer:
isolcpus=unknownflag
Quoted 8 lines
Advance only when the parser is not already at the terminating NUL, preserving existing parsing semantics while avoiding the invalid read.
Fixes 3662daf02350 ("sched/isolation: Allow "isolcpus=" to skip unknown sub-parameters")Cc Steven Rostedt <[email protected]>Assisted-by Codex:GPT-5Signed-off-by Joseph Salisbury <[email protected]>
-- Steve