[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFy3YLnP21S1G1j9EPTq56H=MB-RoQmX+obri4is+Dr+dQ@mail.gmail.com>
Date: Mon, 27 Jun 2016 10:16:05 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Andy Lutomirski <luto@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Oleg Nesterov <oleg@...hat.com>, Tejun Heo <tj@...nel.org>,
LKP <lkp@...org>, LKML <linux-kernel@...r.kernel.org>,
kernel test robot <xiaolong.ye@...el.com>
Subject: Re: kthread_stop insanity (Re: [[DEBUG] force] 2642458962: BUG:
unable to handle kernel paging request at ffffc90000997f18)
On Sun, Jun 26, 2016 at 10:22 PM, Andy Lutomirski <luto@...nel.org> wrote:
>
> kthread_stop is *sick*.
>
> struct kthread self;
>
>
> current->vfork_done = &self.exited;
>
>
> do_exit(ret);
>
> And then some other thread goes and waits for the completion, which is
> *on the stack*, which, in any sane world (e.g. with my series
> applied), is long gone by then.
Yeah. To be fair, that used to work. And the waiter does actually get
a reference to the task struct, and with the lifetime of the stack
historically being the same as the task struct, it was even being
fairly careful about it.
But yes, it's disgusting, and doesn't work in the new world order, and
I think it should be fairly easy to fix. Although getting the lifetime
right for a separately allocated "struct kthread_struct" might be a
bit exciting.
Linus
Powered by blists - more mailing lists