mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joseph Salisbury <joseph.salisbury@oracle.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [External] : Re: [PATCH] sched/isolation: avoid reading past string in isolcpus parser
Date: Mon, 9 Mar 2026 17:49:50 -0400	[thread overview]
Message-ID: <2c0b3733-01e7-43df-b77c-964a2bc2a363@oracle.com> (raw)
In-Reply-To: <20260309100503.1966a491@gandalf.local.home>



On 3/9/26 10:05 AM, Steven Rostedt wrote:
> On Fri,  6 Mar 2026 14:59:08 -0800
> Joseph Salisbury <joseph.salisbury@oracle.com> wrote:
>
>> 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.
> Nice catch.
>
>> Fixes: 3662daf02350 ("sched/isolation: Allow "isolcpus=" to skip unknown sub-parameters")
>> Cc: stable@vger.kernel.org
>> Assisted-by: Codex:GPT-5.3
>> Signed-off-by: Joseph Salisbury <joseph.salisbury@oracle.com>
>> ---
>>   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++;
> Although it should only be a ',' here, I think it's more robust to just
> test against non-nul character. As the bug only triggers if str points to
> the nul character. No need to make this check depend on the rest of the
> algorithm.
>
> 		if (*str)
> 			str++;
>
> -- Steve
Thanks for the feedback and suggestion, Steve!  I'll send a v2 with a 
test for a non-nul character.
>
>
>>   	}
>>   
>>   	/* Default behaviour for isolcpus without flags */


      reply	other threads:[~2026-03-09 21:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-06 22:59 Joseph Salisbury
2026-03-09 14:05 ` Steven Rostedt
2026-03-09 21:49   ` Joseph Salisbury [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2c0b3733-01e7-43df-b77c-964a2bc2a363@oracle.com \
    --to=joseph.salisbury@oracle.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®