[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87sged3a9n.fsf_-_@x220.int.ebiederm.org>
Date: Mon, 29 Jun 2020 15:08:36 -0500
From: ebiederm@...ssion.com (Eric W. Biederman)
To: <linux-kernel@...r.kernel.org>
Cc: David Miller <davem@...emloft.net>,
Greg Kroah-Hartman <greg@...ah.com>,
Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
Alexei Starovoitov <alexei.starovoitov@...il.com>,
Kees Cook <keescook@...omium.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Alexei Starovoitov <ast@...nel.org>,
Al Viro <viro@...iv.linux.org.uk>, bpf <bpf@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Jakub Kicinski <kuba@...nel.org>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Gary Lin <GLin@...e.com>, Bruno Meneguele <bmeneg@...hat.com>,
LSM List <linux-security-module@...r.kernel.org>,
Casey Schaufler <casey@...aufler-ca.com>,
Luis Chamberlain <mcgrof@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: [PATCH v2 15/15] umd: Stop using split_argv
There is exactly one argument so there is nothing to split. All
split_argv does now is cause confusion and avoid the need for a cast
when passing a "const char *" string to call_usermodehelper_setup.
So avoid confusion and the possibility of an odd driver name causing
problems by just using a fixed argv array with a cast in the call to
call_usermodehelper_setup.
Signed-off-by: "Eric W. Biederman" <ebiederm@...ssion.com>
---
kernel/umd.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/kernel/umd.c b/kernel/umd.c
index 4188b71de267..ff79fb16d738 100644
--- a/kernel/umd.c
+++ b/kernel/umd.c
@@ -160,27 +160,21 @@ static void umd_cleanup(struct subprocess_info *info)
int fork_usermode_driver(struct umd_info *info)
{
struct subprocess_info *sub_info;
- char **argv = NULL;
+ const char *argv[] = { info->driver_name, NULL };
int err;
if (WARN_ON_ONCE(info->tgid))
return -EBUSY;
err = -ENOMEM;
- argv = argv_split(GFP_KERNEL, info->driver_name, NULL);
- if (!argv)
- goto out;
-
- sub_info = call_usermodehelper_setup(info->driver_name, argv, NULL,
- GFP_KERNEL,
+ sub_info = call_usermodehelper_setup(info->driver_name,
+ (char **)argv, NULL, GFP_KERNEL,
umd_setup, umd_cleanup, info);
if (!sub_info)
goto out;
err = call_usermodehelper_exec(sub_info, UMH_WAIT_EXEC);
out:
- if (argv)
- argv_free(argv);
return err;
}
EXPORT_SYMBOL_GPL(fork_usermode_driver);
--
2.25.0
Powered by blists - more mailing lists