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] [day] [month] [year] [list]
Date:	Wed, 23 Sep 2009 20:15:58 -0400
From:	Neil Horman <nhorman@...driver.com>
To:	Sebastian Andrzej Siewior <sebastian@...akpoint.cc>
Cc:	linux-kernel@...r.kernel.org,
	Rusty Russell <rusty@...tcorp.com.au>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH] Revert "kmod: fix race in usermodehelper code"

On Thu, Sep 24, 2009 at 01:02:55AM +0200, Sebastian Andrzej Siewior wrote:
> This reverts commit c02e3f361:
> |Author: Neil Horman <nhorman@...driver.com>
> |Date:   Tue Sep 22 16:43:36 2009 -0700
> |
> |    kmod: fix race in usermodehelper code
> |
> |    The user mode helper code has a race in it.  call_usermodehelper_exec()
> |    takes an allocated subprocess_info structure, which it passes to a
> |    workqueue, and then passes it to a kernel thread which it creates, after
> |    which it calls complete to signal to the caller of
> |    call_usermodehelper_exec() that it can free the subprocess_info struct.
> |
> |    But since we use that structure in the created thread, we can't call
> |    complete from __call_usermodehelper(), which is where we create the kernel
> |    thread.  We need to call complete() from within the kernel thread and then
> |    not use subprocess_info afterward in the case of UMH_WAIT_EXEC.  Tested
> |    successfully by me.
> |
> |    Signed-off-by: Neil Horman <nhorman@...driver.com>
> |    Cc: Rusty Russell <rusty@...tcorp.com.au>
> |    Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> |    Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>
> 
> The pach is wrong IMHO. UMH_WAIT_EXEC is called with VFORK what ensures
> that the child finishes prior returing back to the parent. No race. The patch
> makes it even worse because it does the thing it claims not do:
Dang, you're right.  I completely missed the use of CLONE_VFORK as a mechanism
to prevent the parent from racing ahead of the child.  Sorry for the noise.
Neil

> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ