lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 5 Feb 2020 08:34:08 -0500
From:   Peter Xu <peterx@...hat.com>
To:     Ming Lei <ming.lei@...hat.com>
Cc:     linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Juri Lelli <juri.lelli@...hat.com>,
        Luiz Capitulino <lcapitulino@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] sched/isolation: Allow "isolcpus=" to skip unknown
 sub-parameters

On Wed, Feb 05, 2020 at 08:27:54PM +0800, Ming Lei wrote:
> On Tue, Feb 04, 2020 at 11:16:39AM -0500, Peter Xu wrote:
> > The "isolcpus=" parameter allows sub-parameters to exist before the
> > cpulist is specified, and if it sees unknown sub-parameters the whole
> > parameter will be ignored.  This design is incompatible with itself
> > when we add more sub-parameters to "isolcpus=", because the old
> > kernels will not recognize the new "isolcpus=" sub-parameters, then it
> > will invalidate the whole parameter so the CPU isolation will not
> > really take effect if we start to use the new sub-parameters while
> > later we reboot into an old kernel. Instead we will see this when
> > booting the old kernel:
> > 
> >     isolcpus: Error, unknown flag
> > 
> > The better and compatible way is to allow "isolcpus=" to skip unknown
> > sub-parameters, so that even if we add new sub-parameters to it the
> > old kernel will still be able to behave as usual even if with the new
> > sub-parameter is specified.
> > 
> > Ideally this patch should be there when we introduce the first
> > sub-parameter for "isolcpus=", so it's already a bit late.  However
> > late is better than nothing.
> > 
> > CC: Ming Lei <ming.lei@...hat.com>
> > CC: Ingo Molnar <mingo@...hat.com>
> > CC: Peter Zijlstra <peterz@...radead.org>
> > CC: Juri Lelli <juri.lelli@...hat.com>
> > CC: Luiz Capitulino <lcapitulino@...hat.com>
> > Suggested-by: Thomas Gleixner <tglx@...utronix.de>
> > Signed-off-by: Peter Xu <peterx@...hat.com>
> > ---
> >  kernel/sched/isolation.c | 8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> > 
> > diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
> > index 008d6ac2342b..d5defb667bbc 100644
> > --- a/kernel/sched/isolation.c
> > +++ b/kernel/sched/isolation.c
> > @@ -169,8 +169,12 @@ static int __init housekeeping_isolcpus_setup(char *str)
> >  			continue;
> >  		}
> >  
> > -		pr_warn("isolcpus: Error, unknown flag\n");
> > -		return 0;
> > +		str = strchr(str, ',');
> > +		if (str)
> > +			/* Skip unknown sub-parameter */
> > +			str++;
> > +		else
> > +			return 0;
> 
> Looks fine, even though the 'old' kernel has to apply this patch. 

Right, I think this suites for stable.  However I guess there's no way
we can really fix this on all old kernel binaries, which is really a
lesson that we should always design the parameters to be compatible
with the old binaries.

> 
> Reviewed-by: Ming Lei <ming.lei@...hat.com>

Thanks!

-- 
Peter Xu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ