Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp945708ybm; Fri, 29 May 2020 16:29:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIfsy8hqCYEevCnsQ3Gr1IpgAu5FvVQuBisVXJviQVKvMXEbwjTmzDbw97mXZ0eEctDsN7 X-Received: by 2002:a17:906:799:: with SMTP id l25mr6288291ejc.114.1590794987782; Fri, 29 May 2020 16:29:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590794987; cv=none; d=google.com; s=arc-20160816; b=QRp1P/cRpVL6wVUwdLjN1T2+URVFWVpGHq1JyAE6IseSLmanDpaFmEjM/YYFY0ROIf S3aNTZQYwOxSpeT2uZYiOBo+J1W/a/fsTZRKDbYYogiaT/r0dttXqTOYQih4QL9ein7g Cil3UMLBXTt0UfuHPvJTML74+pEKcP9C1uEweJLzZSl4SIGoPEoEeEGVJi/hk9c68bjZ XW1C8WgWZGzZu5rQDjbJGTq0fZcCMzBpefgeVo5YyT8wfv70MQ/fic0SFX0xMtD7s3P6 od/iugc3TPqqhKiF9SumBXz0Ny36N0/aaKr64JzQlRfbpIi7Tec/eyIANe24I+uWkxIU QbNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=+8Yyr8Ni+DQ4LsDdxFUnguFk/+VErG3onkaOmIPr8Qw=; b=p5rrV2i/pl0NHzvHfyXnPvkrIjowGgj4ZeCmZDxommYknOmfRn8lVOyNnqv2GcTMLz RPxzdDPRTe/dnuSjtmkjRNmEP42mnZR3gmY9Jf0vo/9bA+0Iy8hie/6xT7zFMH6M95hw ZBnvu+tAaMEOXZCQSppdJL5xN9855rTgwnt7GHIu+f+S5R9L+WwkpbHp1L3H6+TlfqXL vGqNfR0yw8rl95BJmqgcvmOpVU/XB+G8LIur+tYwk1WvYtFMBy+mUqf/Izgpjn/8gFnD cWE6wTQUQWQgUirJKzs50wnko6BmMf/kU6i330ORnGjcmYkfPr0+3vryNe6fxHe/DpNe evkg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do22si8406265ejc.79.2020.05.29.16.29.24; Fri, 29 May 2020 16:29:47 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728585AbgE2X13 (ORCPT + 99 others); Fri, 29 May 2020 19:27:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728294AbgE2X1Z (ORCPT ); Fri, 29 May 2020 19:27:25 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 059D5C08C5C9; Fri, 29 May 2020 16:27:25 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.93 #3 (Red Hat Linux)) id 1jeoPL-000Bha-HJ; Fri, 29 May 2020 23:27:23 +0000 From: Al Viro To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 2/9] binfmt_elf: don't bother with __{put,copy_to}_user() Date: Sat, 30 May 2020 00:27:17 +0100 Message-Id: <20200529232723.44942-2-viro@ZenIV.linux.org.uk> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200529232723.44942-1-viro@ZenIV.linux.org.uk> References: <20200528234025.GT23230@ZenIV.linux.org.uk> <20200529232723.44942-1-viro@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro Signed-off-by: Al Viro --- fs/binfmt_elf.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 13f25e241ac4..782d218c3bb9 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -202,7 +202,7 @@ create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec, size_t len = strlen(k_platform) + 1; u_platform = (elf_addr_t __user *)STACK_ALLOC(p, len); - if (__copy_to_user(u_platform, k_platform, len)) + if (copy_to_user(u_platform, k_platform, len)) return -EFAULT; } @@ -215,7 +215,7 @@ create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec, size_t len = strlen(k_base_platform) + 1; u_base_platform = (elf_addr_t __user *)STACK_ALLOC(p, len); - if (__copy_to_user(u_base_platform, k_base_platform, len)) + if (copy_to_user(u_base_platform, k_base_platform, len)) return -EFAULT; } @@ -225,7 +225,7 @@ create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec, get_random_bytes(k_rand_bytes, sizeof(k_rand_bytes)); u_rand_bytes = (elf_addr_t __user *) STACK_ALLOC(p, sizeof(k_rand_bytes)); - if (__copy_to_user(u_rand_bytes, k_rand_bytes, sizeof(k_rand_bytes))) + if (copy_to_user(u_rand_bytes, k_rand_bytes, sizeof(k_rand_bytes))) return -EFAULT; /* Create the ELF interpreter info */ @@ -308,14 +308,14 @@ create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec, return -EFAULT; /* Now, let's put argc (and argv, envp if appropriate) on the stack */ - if (__put_user(argc, sp++)) + if (put_user(argc, sp++)) return -EFAULT; /* Populate list of argv pointers back to argv strings. */ p = mm->arg_end = mm->arg_start; while (argc-- > 0) { size_t len; - if (__put_user((elf_addr_t)p, sp++)) + if (put_user((elf_addr_t)p, sp++)) return -EFAULT; len = strnlen_user((void __user *)p, MAX_ARG_STRLEN); if (!len || len > MAX_ARG_STRLEN) @@ -330,14 +330,14 @@ create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec, mm->env_end = mm->env_start = p; while (envc-- > 0) { size_t len; - if (__put_user((elf_addr_t)p, sp++)) + if (put_user((elf_addr_t)p, sp++)) return -EFAULT; len = strnlen_user((void __user *)p, MAX_ARG_STRLEN); if (!len || len > MAX_ARG_STRLEN) return -EINVAL; p += len; } - if (__put_user(0, sp++)) + if (put_user(0, sp++)) return -EFAULT; mm->env_end = p; -- 2.11.0