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-=wg9eqtrpYrjJ=yobkwkTimWFtiDd_JOfADttG0fyAJrqg@mail.gmail.com>
Date:   Sun, 26 Jun 2022 12:59:09 -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 3/3] kthread: Stop abusing TASK_UNINTERRUPTIBLE (INCOMPLETE)

On Sun, Jun 26, 2022 at 12:16 PM Eric W. Biederman
<ebiederm@...ssion.com> wrote:
>
> Instead leave the task as a new unscheduled task and require the
> caller to call wake_up_new_task.

So I think this is somewhat error-prone, and we should probably
abstract things out a bit more.

Almost every single case that does this does this for one single
reason: it wants to run setup code before the new kthread is actually
activated.

And I think *that* should be the change - add a "setup()" function
pointer to the whole kthread infrastructure. Allow it to return an
error, which will then just kill the new thread again without ever
even starting it up.

I'd really prefer to avoid having random drivers and subsystems know
about the *very* magical "wake_up_new_task()" thing.  Yes, it's a real
thing, but it's a thing that normal code should not ever use.

The whole "wake_up_process()" model for kthread creation was wrong.
But moving existing users of a bad interface to using the even more
special "wake_up_new_task()" thing is not the solution, I feel.

Also, since you're very much in this area - you also please look into
getting rid of that horrible 'done' completion pointer entirely? The
xchg games on that thing are horrendous and very non-intuitive.

              Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ