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: <20180628080352.3l24sdhxz7633sfw@pengutronix.de>
Date:   Thu, 28 Jun 2018 10:03:52 +0200
From:   Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Gavin Schenk <g.schenk@...elmann.de>,
        "Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
        linux-kernel@...r.kernel.org, Oleg Nesterov <oleg@...hat.com>,
        "Eric W . Biederman" <ebiederm@...ssion.com>,
        kernel@...gutronix.de, Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] RFC: siox: don't create a thread without starting it

Hello Peter,

On Tue, Jun 26, 2018 at 09:38:41AM +0200, Peter Zijlstra wrote:
> On Mon, Jun 25, 2018 at 09:21:21PM +0200, Uwe Kleine-König wrote:
> > > I don't think so, that patch has an issue with INTERRUPTIBLE, but IDLE
> > > very much doesn't allow signals like INTERRUPTIBLE does.
> > 
> > I don't think I can provide a good commit log for
> > s/TASK_UNINTERRUPTIBLE/TASK_IDLE/ in kernel/kthread.c:kthread(). But I
> > can confirm that this patch makes the warning go away, so if you want to
> > address this, you can add my Tested-by:.
> 
> Yeah, it's also a little bit more involved, I'd also have to change all
> the kthread_bind() code and audit all kthread users to see if anybody
> else actually relies on TASK_UNINTERRUPTIBLE.
> 
> So I think I'll leave it as is for now, maybe another day ... :-)

Should we add a reminder to kthread() à la:

--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -227,7 +227,14 @@ static int kthread(void *_create)
        init_completion(&self->parked);
        current->vfork_done = &self->exited;
 
-       /* OK, tell user we're spawned, wait for stop or wakeup */
+       /*
+        * OK, tell user we're spawned, wait for stop or wakeup.
+        * It might be possible to use TASK_IDLE here to not trigger the
+        * hung-task-check if the creator doesn't run the thread immediately.
+        * Changing this would however need some research first as this has an
+        * effect on e.g. kthread_bind() or the caller might rely on
+        * TASK_UNINTERRUPTIBLE.
+        */
        __set_current_state(TASK_UNINTERRUPTIBLE);
        create->result = current;
        complete(done);

?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ