Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1628928ybt; Thu, 2 Jul 2020 09:49:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxttczk4xVoVbdOvYsdNTxzGxQaEVsHxYT09MRZcrJVuz8EVZNach3T3xGnXeEalzmp1E7Z X-Received: by 2002:a17:906:60d0:: with SMTP id f16mr23971091ejk.17.1593708593336; Thu, 02 Jul 2020 09:49:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593708593; cv=none; d=google.com; s=arc-20160816; b=JCuLnODZEdZlVbxZDDCfdg708yIzQEc3fQhEv4mljrB/4N+/LTwQ1IP1IJAqfAQWuN NkQngpZESi+9+X51SQ8TG7aj+INsyS1pXo07gPuQmO6EKdqAOIGrMhBaOXyz1D985Oa1 89D84/cKtQaU/nJXxDdrM090cyUQ+66RfLxBsSlPtrY/DTQbS7ac0/eKBYl0QEHL5Pcx ZDpeBL7UWdd6hY5MDFLanzOrsChzM0a5dHTMm7f2qpZC1ogUKcr9CEWsuLZwlOq//6ZY ixe6NadEOxaTeKIvbdFscM8pv1BXYiUxUeohyEQlt1Q5xR9ypLvcZ/Gk6dNW046uUhR+ /2wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:cc:to:from; bh=9swAXSJllln2aXC5ZryKfjfTEFduKvAp4DCVwg/qypk=; b=HYzaafTUKwQDpMUaqRyIRtYE0rrAC/UfnlmQH6oHjzMHFoHL9ofwKH3TkL89uWfmEZ SbIQCuDPStpLcN7w5RNgszGp6ryqdXijg4QGQum5T6btONb3RQ8NudyJMUmMVkIABdpf JxaUBY3od0HmpMOs//xv9l3NdKyoRUdfvICyHs64ZNFhajjD3XGopzcno270H+OTQ2TZ NFUS5CxhXF3AIId5FSTTuWlFO8hhC5vvr7GUCxYQx5wJRyb5amsLVKQtJo4rtfPKT8xR 4X7GJJYD4ZRhNaC804uqdbNyZpsys2bMJ0mAb4XoUZC094O17c8XpYPGgKj23bwDKpeJ LoUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si6985973edv.174.2020.07.02.09.49.30; Thu, 02 Jul 2020 09:49:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727803AbgGBQsl (ORCPT + 99 others); Thu, 2 Jul 2020 12:48:41 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:35290 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726721AbgGBQsh (ORCPT ); Thu, 2 Jul 2020 12:48:37 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out02.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jr2O4-0007e6-OQ; Thu, 02 Jul 2020 10:48:36 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95] helo=x220.int.ebiederm.org) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1jr2Nx-0007up-Jp; Thu, 02 Jul 2020 10:48:30 -0600 From: "Eric W. Biederman" To: linux-kernel@vger.kernel.org Cc: David Miller , Greg Kroah-Hartman , Tetsuo Handa , Alexei Starovoitov , Kees Cook , Andrew Morton , Alexei Starovoitov , Al Viro , bpf , linux-fsdevel , Daniel Borkmann , Jakub Kicinski , Masahiro Yamada , Gary Lin , Bruno Meneguele , LSM List , Casey Schaufler , Luis Chamberlain , Linus Torvalds , Christian Brauner , "Eric W. Biederman" Date: Thu, 2 Jul 2020 11:41:40 -0500 Message-Id: <20200702164140.4468-16-ebiederm@xmission.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <87y2o1swee.fsf_-_@x220.int.ebiederm.org> References: <87y2o1swee.fsf_-_@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-XM-SPF: eid=1jr2Nx-0007up-Jp;;;mid=<20200702164140.4468-16-ebiederm@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18OB1SGxTOeo4/dzJbPeWbHPytle+s5LkM= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa02.xmission.com X-Spam-Level: X-Spam-Status: No, score=-0.2 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01 autolearn=disabled version=3.4.2 X-Spam-Virus: No X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4999] * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa02 0; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: ; sa02 0; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;linux-kernel@vger.kernel.org X-Spam-Relay-Country: X-Spam-Timing: total 396 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 4.5 (1.1%), b_tie_ro: 3.1 (0.8%), parse: 1.17 (0.3%), extract_message_metadata: 12 (3.0%), get_uri_detail_list: 1.63 (0.4%), tests_pri_-1000: 11 (2.9%), tests_pri_-950: 1.04 (0.3%), tests_pri_-900: 0.84 (0.2%), tests_pri_-90: 160 (40.5%), check_bayes: 159 (40.1%), b_tokenize: 6 (1.5%), b_tok_get_all: 6 (1.6%), b_comp_prob: 1.84 (0.5%), b_tok_touch_all: 142 (35.7%), b_finish: 0.79 (0.2%), tests_pri_0: 192 (48.6%), check_dkim_signature: 0.40 (0.1%), check_dkim_adsp: 2.4 (0.6%), poll_dns_idle: 0.96 (0.2%), tests_pri_10: 2.5 (0.6%), tests_pri_500: 7 (1.8%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH v3 16/16] umd: Stop using split_argv X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. v1: https://lkml.kernel.org/r/87sged3a9n.fsf_-_@x220.int.ebiederm.org Signed-off-by: "Eric W. Biederman" --- kernel/usermode_driver.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/kernel/usermode_driver.c b/kernel/usermode_driver.c index cd136f86f799..0b35212ffc3d 100644 --- a/kernel/usermode_driver.c +++ b/kernel/usermode_driver.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