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, 4 Dec 2019 14:48:13 +0100
From:   Vincent Guittot <vincent.guittot@...aro.org>
To:     Qais Yousef <qais.yousef@....com>
Cc:     Valentin Schneider <valentin.schneider@....com>,
        John Stultz <john.stultz@...aro.org>,
        Quentin Perret <qperret@...gle.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Juri Lelli <juri.lelli@...hat.com>,
        Patrick Bellasi <Patrick.Bellasi@....com>,
        Ingo Molnar <mingo@...nel.org>,
        lkml <linux-kernel@...r.kernel.org>
Subject: Re: Null pointer crash at find_idlest_group on db845c w/ linus/master

On Wed, 4 Dec 2019 at 14:32, Qais Yousef <qais.yousef@....com> wrote:
>
> On 12/04/19 13:08, Vincent Guittot wrote:
> > On Wed, 4 Dec 2019 at 11:41, Valentin Schneider
> > <valentin.schneider@....com> wrote:
> > >
> > > On 04/12/2019 10:09, Vincent Guittot wrote:
> > > > Now, we test that a group has at least one allowed CPU for the task so we
> > > > could skip the local group with the correct/wrong p->cpus_ptr
> > > >
> > > > The path is used for fork/exec ibut also for wakeup path for b.L when the task doesn't fit in the CPUs
> > > >
> > > > So we can probably imagine a scenario where we change task affinity while
> > > > sleeping. If the wakeup happens on a CPU that belongs to the group that is not
> > > > allowed, we can imagine that we skip the local_group
> > > >
> > >
> > > Shoot, I think you're right. If it is the local group that is NULL, then
> > > we most likely splat on:
> > >
> > >                 if (local->sgc->max_capacity >= idlest->sgc->max_capacity)
> > >                         return NULL;
> > >
> > > We don't splat before because we just use local_sgs, which is uninitialized
> > > but on the stack.
> > >
> > > Also; does it really have to involve an affinity "race"? AFAIU affinity
> > > could have been changed a while back, but the waking CPU isn't allowed
> > > so we skip the local_group (in simpler cases where each CPU is a group).
> >
> > In fact, this will depend of the uninitialized values of local_sgs. I
> > have been able to reproduce the situation where we skip local group
> > but not to trigger the crash because the values already in the stack
> > don't trigger the misfit comparison.
>
> Will it be expensive to initialize local_sgs = {0}?

if we want to initialize local_sgs, it should be something like
local_sgs =  {
.avg_load = UINT_MAX,
.group_type = group_overloaded,
};

to make sure that we will not select local. This doesn't reflect any
kind of reality whereas local=NULL is more meaningful and more robust
IMO


>
> --
> Qais Yousef

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ