From patchwork Fri Mar 26 14:38:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12166897 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5AACC433C1 for ; Fri, 26 Mar 2021 14:41:28 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 848C361A05 for ; Fri, 26 Mar 2021 14:41:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 848C361A05 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=D/SfOJmCvY/y477wr3eY9+tf70kGq0cN2a7ILTrm6qs=; b=KdYRYLo3Z/N1c1k55S19RKy2v S1dJp5AvNY2rBiNN2ADq0AToYhYVpsL00DjkoxnF/MHKsQxmkdg0okU7QFNVs6U2K0vdmtOnMKbH2 pJB8CtgmHrCR7TbUpOcx/skd0DJIgfl6nmKRjzlIzZlVTporSBUcH211qbvXSMHckpqigdxK9hbFl ChfniOEZz9d2sMubnw7zNIlF74hTBsdSgAOWSrMLLInq4PcDw/XaLEfqAhZZRcAgBgIt1mx3/K+IS FsNDvDI/Vl45O0KVJWeX6tm/EEg0N6M+w3QTlOzawKZ0M0DxSfAyG4wZBczNttArequfg6tGNS+8x EMUoLTibw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lPncb-003oC6-W8; Fri, 26 Mar 2021 14:39:34 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lPncJ-003o8Q-Oo for linux-arm-kernel@lists.infradead.org; Fri, 26 Mar 2021 14:39:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=ik1ZxFDTbN543xAdjkIaY+LrhRyZTgPPWblbYOdt+Ho=; b=nG0Tk1zj75N7RMl5ukKyw29ZN3 b+NOjFYQo+wu7oBBfqqtji5laQisXQUxuPMbt4PIZGaF5UD040L3w0xZQgANcLCj4xlzSLv5c2bi0 lg9LbshcQpAREZtrDf18Q/SG8yTj+moIlWxcm5A0jZuwX9nyD35AhobYsHKdA5fX54UC0vHu8806g gsQQ4ddMqtHcBjByEmM6PFfM8jGudMsMvUmqfrPkPqsQZUPyECPVNPi/pHwO/6wQl9g9tp+eSJhLo ky70B67w9ulsBx+95/RE/FpcWOmqKKR/GxCJeqMv1ybsBv6RXTwNNLaTgHmzPqWkAYUa8nGsQP8tS c4NX3KcA==; Received: from [213.208.157.35] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lPnbr-005U6S-Bx; Fri, 26 Mar 2021 14:38:47 +0000 From: Christoph Hellwig To: "Eric W. Biederman" , Al Viro Cc: Arnd Bergmann , Brian Gerst , Luis Chamberlain , linux-arm-kernel@lists.infradead.org, x86@kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] exec: remove do_execve Date: Fri, 26 Mar 2021 15:38:28 +0100 Message-Id: <20210326143831.1550030-2-hch@lst.de> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210326143831.1550030-1-hch@lst.de> References: <20210326143831.1550030-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Just call do_execveat instead. Signed-off-by: Christoph Hellwig Reviewed-by: Arnd Bergmann --- fs/exec.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/fs/exec.c b/fs/exec.c index 18594f11c31fe1..b63fb020909075 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1978,15 +1978,6 @@ int kernel_execve(const char *kernel_filename, return retval; } -static int do_execve(struct filename *filename, - const char __user *const __user *__argv, - const char __user *const __user *__envp) -{ - struct user_arg_ptr argv = { .ptr.native = __argv }; - struct user_arg_ptr envp = { .ptr.native = __envp }; - return do_execveat_common(AT_FDCWD, filename, argv, envp, 0); -} - static int do_execveat(int fd, struct filename *filename, const char __user *const __user *__argv, const char __user *const __user *__envp, @@ -2060,7 +2051,7 @@ SYSCALL_DEFINE3(execve, const char __user *const __user *, argv, const char __user *const __user *, envp) { - return do_execve(getname(filename), argv, envp); + return do_execveat(AT_FDCWD, getname(filename), argv, envp, 0); } SYSCALL_DEFINE5(execveat,