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] [day] [month] [year] [list]
Date:   Mon, 30 Jan 2017 15:01:15 +0100
From:   Oleg Nesterov <oleg@...hat.com>
To:     Pavel Tikhomirov <ptikhomirov@...tuozzo.com>
Cc:     Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Cyrill Gorcunov <gorcunov@...nvz.org>,
        John Stultz <john.stultz@...aro.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Nicolas Pitre <nicolas.pitre@...aro.org>,
        Michal Hocko <mhocko@...e.com>,
        Stanislav Kinsburskiy <skinsbursky@...tuozzo.com>,
        Mateusz Guzik <mguzik@...hat.com>,
        linux-kernel@...r.kernel.org,
        Pavel Emelyanov <xemul@...tuozzo.com>,
        Konstantin Khorenko <khorenko@...tuozzo.com>,
        Lennart Poettering <lennart@...ttering.net>,
        "Eric W . Biederman" <ebiederm@...ssion.com>,
        Kay Sievers <kay.sievers@...y.org>
Subject: Re: [PATCH v2 2/2] prctl: propagate has_child_subreaper flag to
 every descendant

On 01/30, Pavel Tikhomirov wrote:
>
> On 01/30/2017 03:51 PM, Oleg Nesterov wrote:
> >>+			/*
> >>+			 * Inherit has_child_subreaper flag under the same
> >>+			 * tasklist_lock with adding child to the process tree
> >>+			 * for propagate_has_child_subreaper optimization.
> >>+			 */
> >>+			p->signal->has_child_subreaper = current->signal->has_child_subreaper ||
> >>+							 current->signal->is_child_subreaper;
> >
> >Ah yes, we need this change too...
> >
> >And perhaps it would be more correct to do
> >
> >			p->signal->has_child_subreaper =
> >				p->real_parent->signal->has_child_subreaper ||
> >				p->real_parent->signal->is_child_subreaper;
> >
> >the current code is not exactly right if CLONE_PARENT...
>
> I'm fine with inheriting 'has' flag from real_parent, because if real_parent
> does not have 'has' flag set but parent has 'has' set, we inherited the flag
> in vain.
>
> But I don't actually think that inheritance from parent not real_parent
> breaks my optimization: if real_parent has the flag, so does the parent.

Not sure I understand... I meant, the usage of p->real_parent instead of "current"
_looks_ more correct and clear, imo.

Say, a is_child_subreaper task does clone(CLONE_PARENT), in this case (with or
without your change) we set p->signal->has_child_subreaper = 1 and this is not
really correct even if we do not really care.

Oleg.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ