* [PATCH] Restore call_usermodehelper_pipe() behaviour
@ 2007-09-04 6:37 Michael Ellerman
2007-09-04 7:17 ` Andi Kleen
0 siblings, 1 reply; 2+ messages in thread
From: Michael Ellerman @ 2007-09-04 6:37 UTC (permalink / raw)
To: Andrew Morton
Cc: jeremy, ak, rusty, dhowells, B.Steinbrink, randy.dunlap,
linux-kernel
The semantics of call_usermodehelper_pipe() used to be that it would fork
the helper, and wait for the kernel thread to be started. This was
implemented by setting sub_info.wait to 0 (implicitly), and doing a
wait_for_completion().
As part of the cleanup done in 0ab4dc92278a0f3816e486d6350c6652a72e06c8,
call_usermodehelper_pipe() was changed to pass 1 as the value for wait to
call_usermodehelper_exec().
This is equivalent to setting sub_info.wait to 1, which is a change from
the previous behaviour. Using 1 instead of 0 causes __call_usermodehelper()
to start the kernel thread running wait_for_helper(), rather than directly
calling ____call_usermodehelper().
The end result is that the calling kernel code blocks until the user mode
helper finishes. As the helper is expecting input on stdin, and now no one
is writing anything, everything locks up (observed in do_coredump).
The fix is to change the 1 to UMH_WAIT_EXEC (aka 0), indicating that we want
to wait for the kernel thread to be started, but not for the helper to finish.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
kernel/kmod.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/kmod.c b/kernel/kmod.c
index 9809cc1..c6a4f8a 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -505,7 +505,7 @@ int call_usermodehelper_pipe(char *path, char **argv, char **envp,
if (ret < 0)
goto out;
- return call_usermodehelper_exec(sub_info, 1);
+ return call_usermodehelper_exec(sub_info, UMH_WAIT_EXEC);
out:
call_usermodehelper_freeinfo(sub_info);
--
1.5.1.3.g7a33b
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Restore call_usermodehelper_pipe() behaviour
2007-09-04 6:37 [PATCH] Restore call_usermodehelper_pipe() behaviour Michael Ellerman
@ 2007-09-04 7:17 ` Andi Kleen
0 siblings, 0 replies; 2+ messages in thread
From: Andi Kleen @ 2007-09-04 7:17 UTC (permalink / raw)
To: Michael Ellerman
Cc: Andrew Morton, jeremy, rusty, dhowells, B.Steinbrink,
randy.dunlap, linux-kernel
> The fix is to change the 1 to UMH_WAIT_EXEC (aka 0), indicating that we
> want to wait for the kernel thread to be started, but not for the helper to
> finish.
Looks good. Clear 2.6.23 candidate IMHO
-Andi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-09-04 7:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-04 6:37 [PATCH] Restore call_usermodehelper_pipe() behaviour Michael Ellerman
2007-09-04 7:17 ` Andi Kleen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.