From patchwork Tue Oct 18 07:14:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 3982 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1818429wrs; Tue, 18 Oct 2022 00:20:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5A+IHhO8q7YZJSKonJTYZZFw/do4AtmiiQcgIVYUugGon4CqYCI8PVuItw8IArzm0IQYKE X-Received: by 2002:a17:903:124e:b0:178:6946:a2ba with SMTP id u14-20020a170903124e00b001786946a2bamr1611589plh.89.1666077647071; Tue, 18 Oct 2022 00:20:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666077647; cv=none; d=google.com; s=arc-20160816; b=1DL6sfboYBVYk2BXG61JuoOorHkDnRYfMyIzx8HKK4Tzp9+ILojNhSUoK06RdfS0Yh F6W8Rmn02JrbE94KaNO6ksHjJ4BxOlQ9fa+eUOPeIencGWakvACzUPxwnwPnAbBZ79Ao hAvyrxs+BoTSbOjFBotiA6iDSAeOnBvWDMRV/N3zQTCHmgfdRip8UsX4liFwDT1ssyct URF05iLP/jlikVB8rK3UaYKK9+u/8sFVIY0xeEvrf5ZxXuDJ+Fn8TwBP7Zk3eH1S6WJ0 pYljudS1PqtK2AeAGwttsrV5iPcQS5fDWbwPZepyGfI/oLZBMXnSzbr2a/7UbdxtjJ88 1Arw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=GWpp9H1EZop5nfcRDk8gH8fsXSS8/W/uxQB86i2A+io=; b=xpEzwC97Ja/y9c5PbCMgOg+6AOzTPBX0/AR3arbFCWuXWXvvxVwXm+Fo7VYv7Ecjik TYK0cO2LddNXCnewniJ3zC0TZcIaY2B2T0iaqqzz9qRT/CfBS5ueGWFmYgKy7ck2q2eA 7H10NWWtIFqbKU09IJ8/kO87ufdAYq5c0U3qKnITS35cs8EvA3ZccBmNNfnGHCGqNWtu CSMXLX7KXD0JNAO3V1Yrfqknp6caeusRwtSjCjP+d8tBzZkPNDWz5LFT+vLYOvn9IVQj QaOZ7cOqvQBgZ4JNuQSPeqonQnacWcEARGgAB0Xf7Zoq+Gq50wvCZJOLNcfHrYMy9SsJ 3Lhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="j28wJE/S"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e19-20020a656793000000b0044930a684c0si14324829pgr.472.2022.10.18.00.20.34; Tue, 18 Oct 2022 00:20:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="j28wJE/S"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230103AbiJRHPq (ORCPT + 99 others); Tue, 18 Oct 2022 03:15:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229891AbiJRHPp (ORCPT ); Tue, 18 Oct 2022 03:15:45 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1962D13D40 for ; Tue, 18 Oct 2022 00:15:26 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id z20so12970920plb.10 for ; Tue, 18 Oct 2022 00:15:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GWpp9H1EZop5nfcRDk8gH8fsXSS8/W/uxQB86i2A+io=; b=j28wJE/SlkqN0MjnlHNEnwUchiYmES1JAhp9HN8BuDU8EpRBzurMvOIs9LRp5sNeZf RftAfN/hdX/ko7MA6Biz+yBsd+AY5JU/+ShMBxe1d7lvQN2y4lPWbXReV5V4nqGAWHx9 ot5LcqpDE7s6Lgyg7GIon+2kl38P5UpfMJVWc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GWpp9H1EZop5nfcRDk8gH8fsXSS8/W/uxQB86i2A+io=; b=gJTVIbZxGVNi7HLDOA1A3m3K8cFRJnn/xgzEpHasS9bU2sHpg6aNaGR24lprenXEjo xMf++VW0JTQEzSHi+rm06S6mtOikK/EcjIUqeU4J2BFoaVF4e6Tax0cgcKUMQT3loEIZ 06Jg6N/PFkDfe4i8UKkDhzxLagbPJ5hkM0cSLg8goeaCT84Ic+mIif1dkyd/1inpgvqQ x8iE6Q0iiYWCI1azUSXStCx4JyFfJuwXof50Ch62Qu0AGOWDOl7d4aVvipP+4UeMLHOd b1/S21pgdybUcVrqT7YPl6imonLfhiCUiyb3aJVV1cV6DyA6ns/7GzbjSO+GbK+1TScZ RoKQ== X-Gm-Message-State: ACrzQf0t6RDp4sDfz5pKEBm2va7r1IWjwk71oj1rUYg6Y4GLXkVrhsBS RFGQdwwVb8FBtYrrzs5v1LwwTQ== X-Received: by 2002:a17:902:d504:b0:184:87ca:7856 with SMTP id b4-20020a170902d50400b0018487ca7856mr1676641plg.14.1666077266556; Tue, 18 Oct 2022 00:14:26 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id r24-20020aa79638000000b00562eff85594sm8488909pfg.121.2022.10.18.00.14.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 00:14:25 -0700 (PDT) From: Kees Cook To: Eric Biederman Cc: Kees Cook , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH] binfmt: Fix whitespace issues Date: Tue, 18 Oct 2022 00:14:20 -0700 Message-Id: <20221018071350.never.230-kees@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3571; h=from:subject:message-id; bh=cE+i46jrzxiQX8hRWgipHvknKIEvjBwuE256znMEhAA=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBjTlJMQjP+BFOX9loYawD8HXVcEROtQbdET4WeOsOD cZ4e/PWJAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCY05STAAKCRCJcvTf3G3AJkrcD/ sFtj1A9f+SIqBDSukZmOj1y+sKcip8qY324JfvKAKVMUBhHgMNYycYLvFgN4PL9VaulC6Og9XQNrRT x8+/bYmLOFyVj6io0h++mn7RXZppKHA7bbHGbR65H75K+adr4MjigqXjr46wFpQ6TSQnbxaNvYVOwN RsGBKaC30dGgZ+RgY3ZMDGKR9bGvzy+Wsk8EZjOE7+CyY9CQkWXK6zmMztiy6xgzLKM/shDN7RETzn hAy8tau5WoDxetf/dD3H/4vDw814pQmvNAytqHdL2N21gvA+RKuP2EOPA7TtgokhurBIMqZL1tKpSk JZyHx9s3rrj6w4kQc2ZGs+bwIX8mFLCqRXzmptgVxPmTcLyl1joXLJaciRKwOo5ld0c7mF9AxaWAYr 9mWmrp9xvEpn5u+HqRvtqwoFgWPRgJ8aNXKmA9AzJt96h+1SSWINhnohcIuJPmaBj0tOgdvgRT50j/ eaCL8MmvU+ClJAfNB+vHT7jBhAaj7UYJErkAOGpuavNtQwb5OUAt0YfdRsvfhSK5ObH9H+4DuRtR3J 71aSWQTotYTtCKwXGkVLNTaHEIHbL44Wmb2ezbYPRaBbz3DUnZr3k+mFHfx+aP9hGn5nLynAJh3wyB A6TlSKrPXFR74vHV4K31OynzNpgIIa6dv1VjGIqMdNoR6if304OxtLjVAWXw== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747009034900633883?= X-GMAIL-MSGID: =?utf-8?q?1747009034900633883?= Fix the annoying whitespace issues that have been following these files around for years. Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Kees Cook Acked-by: Christian Brauner (Microsoft) --- fs/binfmt_elf.c | 14 +++++++------- fs/binfmt_elf_fdpic.c | 2 +- fs/exec.c | 2 +- include/uapi/linux/elf.h | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 63c7ebb0da89..72f0672b4b74 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -248,7 +248,7 @@ create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec, } while (0) #ifdef ARCH_DLINFO - /* + /* * ARCH_DLINFO must come first so PPC can do its special alignment of * AUXV. * update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT() in @@ -1020,7 +1020,7 @@ static int load_elf_binary(struct linux_binprm *bprm) executable_stack); if (retval < 0) goto out_free_dentry; - + elf_bss = 0; elf_brk = 0; @@ -1043,7 +1043,7 @@ static int load_elf_binary(struct linux_binprm *bprm) if (unlikely (elf_brk > elf_bss)) { unsigned long nbyte; - + /* There was a PT_LOAD segment with p_memsz > p_filesz before this one. Map anonymous pages, if needed, and clear the area. */ @@ -1520,7 +1520,7 @@ static void fill_elf_note_phdr(struct elf_phdr *phdr, int sz, loff_t offset) phdr->p_align = 0; } -static void fill_note(struct memelfnote *note, const char *name, int type, +static void fill_note(struct memelfnote *note, const char *name, int type, unsigned int sz, void *data) { note->name = name; @@ -2003,8 +2003,8 @@ static int elf_dump_thread_status(long signr, struct elf_thread_status *t) t->num_notes = 0; fill_prstatus(&t->prstatus.common, p, signr); - elf_core_copy_task_regs(p, &t->prstatus.pr_reg); - + elf_core_copy_task_regs(p, &t->prstatus.pr_reg); + fill_note(&t->notes[0], "CORE", NT_PRSTATUS, sizeof(t->prstatus), &(t->prstatus)); t->num_notes++; @@ -2294,7 +2294,7 @@ static int elf_core_dump(struct coredump_params *cprm) if (!elf_core_write_extra_phdrs(cprm, offset)) goto end_coredump; - /* write out the notes section */ + /* write out the notes section */ if (!write_note_info(&info, cprm)) goto end_coredump; diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index 08d0c8797828..e90c1192dec6 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c @@ -1603,7 +1603,7 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm) if (!elf_core_write_extra_phdrs(cprm, offset)) goto end_coredump; - /* write out the notes section */ + /* write out the notes section */ if (!writenote(thread_list->notes, cprm)) goto end_coredump; if (!writenote(&psinfo_note, cprm)) diff --git a/fs/exec.c b/fs/exec.c index 0284a5f3925e..902bce45b116 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -173,7 +173,7 @@ SYSCALL_DEFINE1(uselib, const char __user *, library) exit: fput(file); out: - return error; + return error; } #endif /* #ifdef CONFIG_USELIB */ diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h index 775a17b5b8ac..4c6a8fa5e7ed 100644 --- a/include/uapi/linux/elf.h +++ b/include/uapi/linux/elf.h @@ -91,7 +91,7 @@ typedef __s64 Elf64_Sxword; #define DT_INIT 12 #define DT_FINI 13 #define DT_SONAME 14 -#define DT_RPATH 15 +#define DT_RPATH 15 #define DT_SYMBOLIC 16 #define DT_REL 17 #define DT_RELSZ 18