lkml.org 
[lkml]   [2008]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] (2.4.25 material?) Fix unbalanced helper_lock in kernel/kmod.c
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>



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;

\
 
 \ /
  Last update: 2008-01-17 01:33    [W:0.206 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site