Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756855AbYAQSB0 (ORCPT ); Thu, 17 Jan 2008 13:01:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753121AbYAQSAI (ORCPT ); Thu, 17 Jan 2008 13:00:08 -0500 Received: from ogre.sisk.pl ([217.79.144.158]:33210 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752858AbYAQSAF (ORCPT ); Thu, 17 Jan 2008 13:00:05 -0500 From: "Rafael J. Wysocki" To: nigel@nigel.suspend2.net Subject: Re: [PATCH] (2.4.25 material?) Fix unbalanced helper_lock in kernel/kmod.c Date: Thu, 17 Jan 2008 19:02:43 +0100 User-Agent: KMail/1.9.6 (enterprise 20070904.708012) Cc: LKML , pm list , TuxOnIce-devel , Andrew Morton , Pavel Machek References: <478EA17B.30601@nigel.suspend2.net> In-Reply-To: <478EA17B.30601@nigel.suspend2.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801171902.44133.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1505 Lines: 49 On Thursday, 17 of January 2008, Nigel Cunningham wrote: > Hi all. Hi, > First up, sorry for not inlining the patch - trouble with line wrapping. No big deal. > 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. Thanks a lot for the patch (reproduced below), I think it's 2.6.24 material. Andrew? > Signed-off-by: Nigel Cunningham --- From: Nigel Cunningham 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. Fix it. Signed-off-by: Nigel Cunningham Signed-off-by: Rafael J. Wysocki --- 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; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/