From: Nigel Cunningham <nigel@nigel.suspend2.net>
To: LKML <linux-kernel@vger.kernel.org>,
pm list <linux-pm@lists.linux-foundation.org>,
TuxOnIce-devel <tuxonice-devel@lists.tuxonice.net>
Subject: [PATCH] (2.4.25 material?) Fix unbalanced helper_lock in kernel/kmod.c
Date: Thu, 17 Jan 2008 11:29:47 +1100 [thread overview]
Message-ID: <478EA17B.30601@nigel.suspend2.net> (raw)
[-- 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;
next reply other threads:[~2008-01-17 0:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-17 0:29 Nigel Cunningham [this message]
2008-01-17 18:02 ` [PATCH] (2.4.25 material?) Fix unbalanced helper_lock in kernel/kmod.c Rafael J. Wysocki
2008-01-17 19:23 ` Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=478EA17B.30601@nigel.suspend2.net \
--to=nigel@nigel.suspend2.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=tuxonice-devel@lists.tuxonice.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox