[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20120711163223.faa40af5.akpm@linux-foundation.org>
Date: Wed, 11 Jul 2012 16:32:23 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Cong Wang <amwang@...hat.com>, linux-kernel@...r.kernel.org,
WANG Cong <xiyou.wangcong@...il.com>,
Cyrill Gorcunov <gorcunov@...nvz.org>,
Kees Cook <keescook@...omium.org>,
Serge Hallyn <serge.hallyn@...onical.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Alan Cox <alan@...rguk.ukuu.org.uk>
Subject: Re: [Patch] kernel/sys.c: fix an incorrect error branch in
orderly_poweroff()
Also, the call_usermodehelper_fns() interface is rather nasty. Let's
try to prevent mistakes:
--- a/kernel/kmod.c~a
+++ a/kernel/kmod.c
@@ -577,6 +577,12 @@ unlock:
return retval;
}
+/*
+ * call_usermodehelper_fns() will not run the caller-provided cleanup function
+ * if a memory allocation failure is experienced. So the caller might need to
+ * check the call_usermodehelper_fns() return value: if it is -ENOMEM, perform
+ * the necessaary cleanup within the caller.
+ */
int call_usermodehelper_fns(
char *path, char **argv, char **envp, int wait,
int (*init)(struct subprocess_info *info, struct cred *new),
_
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists