[PATCH] sched/isolation: avoid reading past string in isolcpus parser

From: Joseph Salisbury

Date: Fri Mar 06 2026 - 18:00:15 EST


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.

Advance only when the current character is a comma separator, preserving
existing parsing semantics while avoiding the invalid read.

Fixes: 3662daf02350 ("sched/isolation: Allow "isolcpus=" to skip unknown sub-parameters")
Cc: stable@xxxxxxxxxxxxxxx
Assisted-by: Codex:GPT-5.3
Signed-off-by: Joseph Salisbury <joseph.salisbury@xxxxxxxxxx>
---
kernel/sched/isolation.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
index ef152d401fe2..4cf253fb6d75 100644
--- a/kernel/sched/isolation.c
+++ b/kernel/sched/isolation.c
@@ -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 */
--
2.47.3