public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] (2.4.25 material?) Fix unbalanced helper_lock in kernel/kmod.c
@ 2008-01-17  0:29 Nigel Cunningham
  2008-01-17 18:02 ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Nigel Cunningham @ 2008-01-17  0:29 UTC (permalink / raw)
  To: LKML, pm list, TuxOnIce-devel

[-- Attachment #1: Type: text/plain, Size: 310 bytes --]

Hi all.

First up, sorry for not inlining the patch - trouble with line wrapping.

In 2.6.24-rc8, call_usermodehelper_exec has an exit path that can leave
the helper_lock() call at the top of the routine unbalanced. The
attached patch fixes this issue.

Signed-off-by: Nigel Cunningham <nigel@tuxonice.net>




[-- Attachment #2: helper-lock-fix.patch --]
[-- Type: text/x-patch, Size: 482 bytes --]

diff --git a/kernel/kmod.c b/kernel/kmod.c
index c6a4f8a..de27e15 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -468,8 +468,10 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info,
 	sub_info->wait = wait;
 
 	queue_work(khelper_wq, &sub_info->work);
-	if (wait == UMH_NO_WAIT) /* task has freed sub_info */
+	if (wait == UMH_NO_WAIT) { /* task has freed sub_info */
+		helper_unlock();
 		return 0;
+	}
 	wait_for_completion(&done);
 	retval = sub_info->retval;
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-01-17 19:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-17  0:29 [PATCH] (2.4.25 material?) Fix unbalanced helper_lock in kernel/kmod.c Nigel Cunningham
2008-01-17 18:02 ` Rafael J. Wysocki
2008-01-17 19:23   ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox