Re: [PATCH v2] sched/isolation: Allow "isolcpus=" to skip unknown sub-parameters

From: Thomas Gleixner
Date: Fri Apr 03 2020 - 16:27:25 EST


Peter Xu <peterx@xxxxxxxxxx> writes:
> On Thu, Apr 02, 2020 at 10:59:29AM -0400, Peter Xu wrote:
>> - pr_warn("isolcpus: Error, unknown flag\n");
>> - return 0;
>> + /*
>> + * Skip unknown sub-parameter and validate that it is not
>> + * containing an invalid character.
>> + */
>> + for (par = str, len = 0; *str && *str != ','; str++, len++)

lacks {


>> + if (!isalpha(*str))
>> + illegal = true;

lacks }

>> +
>> + if (illegal) {
>> + pr_warn("isolcpus: Invalid flag %.*s\n", len, par);
>> + return 0;
>> + }
>> +
>> + pr_info("isolcpus: Skipped unknown flag %.*s\n", len, par);
>> + str++;
>> }
>
> I just noticed this is still problematic if we want to mark this as
> stable, because "managed_irq" violate the "isalpha()" rule already...
> It means even if we apply this patch to the stable trees it'll still
> think managed_irq as illegal and ignore the whole isolcpus=.

if (!isalpha(*str) && *str != '_')

which is what I told you a couple of days ago already.

Thanks,

tglx