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]
Message-ID: <CAHk-=wibXtQ9pjB9ctpy5jWJK93DL19Lj09Et6cYEQE+h7tPpg@mail.gmail.com>
Date:   Fri, 26 Jul 2019 14:26:45 -0700
From:   Linus Torvalds <torvalds@...ux-foundation.org>
To:     Christian Brauner <christian@...uner.io>
Cc:     Linux List Kernel Mailing <linux-kernel@...r.kernel.org>,
        Oleg Nesterov <oleg@...hat.com>, Arnd Bergmann <arnd@...db.de>,
        "Eric W. Biederman" <ebiederm@...ssion.com>,
        Kees Cook <keescook@...omium.org>,
        Joel Fernandes <joel@...lfernandes.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Tejun Heo <tj@...nel.org>, David Howells <dhowells@...hat.com>,
        Jann Horn <jannh@...gle.com>,
        Andrew Lutomirski <luto@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Aleksa Sarai <cyphar@...har.com>,
        Al Viro <viro@...iv.linux.org.uk>,
        Android Kernel Team <kernel-team@...roid.com>
Subject: Re: [PATCH v1 1/2] pidfd: add P_PIDFD to waitid()

On Fri, Jul 26, 2019 at 2:41 AM Christian Brauner <christian@...uner.io> wrote:
>
> -       if (type < PIDTYPE_MAX)
> +       if (type < PIDTYPE_MAX && !pid)
>                 pid = find_get_pid(upid);

So now we have four cases in the switch statement, and two of them do
*not* want that "find_get_pid()" call.

Honestly, let's just move that whole thing into the switch statement
for the two cases that do want it. Particulartly since I think the
"upid == 0" case for P_PGID will prefer it that way anyway.

Let's not check 'type' in two different places in two completely
different ways.

Ok?

             Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ