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:   Sun, 26 Jun 2022 14:20:44 -0700
From:   Linus Torvalds <torvalds@...ux-foundation.org>
To:     "Eric W. Biederman" <ebiederm@...ssion.com>
Cc:     Christian Brauner <brauner@...nel.org>, Tejun Heo <tj@...nel.org>,
        Petr Mladek <pmladek@...e.com>,
        Lai Jiangshan <jiangshanlai@...il.com>,
        Michal Hocko <mhocko@...e.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Oleg Nesterov <oleg@...hat.com>
Subject: Re: [PATCH 1/3] kthread: Remove the flags argument from kernel_thread

On Sun, Jun 26, 2022 at 12:15 PM Eric W. Biederman
<ebiederm@...ssion.com> wrote:
>
> As kthreadd never exists it simply does not matter what kind of exit
> it has.  So for simplicity make it look like everything else and use
> SIGCHLD.

That "never exists" should be "never exits" ;)

But:

> +pid_t kernel_thread(int (*fn)(void *), void *arg)
>  {
> +       unsigned long flags = CLONE_FS | CLONE_FILES | SIGCHLD;
>         struct kernel_clone_args args = {
>                 .flags          = ((lower_32_bits(flags) | CLONE_VM |
>                                     CLONE_UNTRACED) & ~CSIGNAL),

Please just get rid of that 'flags' thing, and the lower_32_bits()
games and write this all as

    pid_t kernel_thread(int (*fn)(void *), void *arg)
    {
        struct kernel_clone_args args = {
                .flags          = CLONE_FS | CLONE_FILES |
                                  CLONE_VM | CLONE_UNTRACED,
                .exit_signal    = SIGCHLD,
                ...

which does that whole thing much more clearly.

              Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ