Re: [Nbd] [PATCH 1/1] kthread: introduce kthread_get_run() to fix __nbd_ioctl()

2015-10-28 Thread Oleg Nesterov
Markus, sorry for delay, I didn't have email access two days, On 10/26, Markus Pargmann wrote: > > On Sun, Oct 25, 2015 at 03:27:13PM +0100, Oleg Nesterov wrote: > > It is not safe to use the task_struct returned by kthread_run(threadfn) > > if threadfn() can exit before the "owner" does

Re: [Nbd] [PATCH 1/1] kthread: introduce kthread_get_run() to fix __nbd_ioctl()

2015-10-28 Thread Oleg Nesterov
On 10/26, Christoph Hellwig wrote: > > On Sun, Oct 25, 2015 at 03:27:13PM +0100, Oleg Nesterov wrote: > > It is not safe to use the task_struct returned by kthread_run(threadfn) > > if threadfn() can exit before the "owner" does kthread_stop(), nothing > > protects this task_struct. > > > > So

Re: [Nbd] [PATCH 1/1] kthread: introduce kthread_get_run() to fix __nbd_ioctl()

2015-10-27 Thread Markus Pargmann
Hi, On Mon, Oct 26, 2015 at 05:26:42PM -0700, Christoph Hellwig wrote: > On Sun, Oct 25, 2015 at 03:27:13PM +0100, Oleg Nesterov wrote: > > It is not safe to use the task_struct returned by kthread_run(threadfn) > > if threadfn() can exit before the "owner" does kthread_stop(), nothing > >

Re: [Nbd] [PATCH 1/1] kthread: introduce kthread_get_run() to fix __nbd_ioctl()

2015-10-26 Thread Markus Pargmann
On Sun, Oct 25, 2015 at 03:27:13PM +0100, Oleg Nesterov wrote: > It is not safe to use the task_struct returned by kthread_run(threadfn) > if threadfn() can exit before the "owner" does kthread_stop(), nothing > protects this task_struct. > > So __nbd_ioctl() looks buggy; a killed

Re: [Nbd] [PATCH 1/1] kthread: introduce kthread_get_run() to fix __nbd_ioctl()

2015-10-26 Thread Christoph Hellwig
On Sun, Oct 25, 2015 at 03:27:13PM +0100, Oleg Nesterov wrote: > It is not safe to use the task_struct returned by kthread_run(threadfn) > if threadfn() can exit before the "owner" does kthread_stop(), nothing > protects this task_struct. > > So __nbd_ioctl() looks buggy; a killed