Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2282433pxa; Mon, 3 Aug 2020 12:02:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiABnxiVgj8Ci9QbSinPLtjEr2hV+GvdwCRIcKzxetU3YZzziFTKmRsNXZTtAt697hfmWI X-Received: by 2002:a17:906:c04d:: with SMTP id bm13mr17488546ejb.321.1596481369354; Mon, 03 Aug 2020 12:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596481369; cv=none; d=google.com; s=arc-20160816; b=ItoUtp59+ws+U6cUlkp1+4DB9aBZ5J5wDAC5f+BeRltVl/TmZsczTZ06gUCSQuLy5a sKiPJf93/W+dc1HFNl15DeR8SouhQm8KGFW0dexGgn6mpgrW3COVasY9jUOEeDKGiKi7 FfNYyu3eURZ7jDegTPziPAMJe0meWwS3X6rVcCnpTgE+B8OWTeImK0d+F99U5R3hpeY6 q6cK/uCtdDG8qdabR0OIb5McntvEC2K5y33ftk+XlDCTbP7/rYN/vQVlzy0kb78xR8+M amo9LaiegcDpJiC4H9PGGb3kJuGu/TtYb24rxJIrcK8DosGs8TjNGNLxFx+srXXKRCtL JdFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=O6tP2dRjUFwZbhO7kTIUZzIPSMn6S/VsoDqV/IeCHas=; b=j4kS7LFbGw/CzKwTC55X8BtOTdmIkwIs142m1uSJyQ37swy+C0BbNDkCjfmQYa3oJa fIuRBuLY0PF5pi2cO50QY8OnYMEqCfT+4vlJP7VvR7ikJyoxC0xrHiTKvrbcAK64L6mI r+4Di7sHAWuyLNAtUDInLs42TyDsgG+snOuSgIxDaOnETu9+NEi7XGFSkTNqI5w78mEm 80RjQOWISRTGw80zzLnUWm26caw3DzGOwtyL6fflyIRPl9VAoROBAOZONo2dXO/7Vell CeEGW9yy3cFx9la9BrHT581B8sFAINZ0GHZi7elV92oPuy82+6WfPT79WYTdDP0aOT1/ CiEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=GwyGimjv; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u21si10906120edi.143.2020.08.03.12.02.25; Mon, 03 Aug 2020 12:02:49 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=GwyGimjv; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726968AbgHCTCU (ORCPT + 99 others); Mon, 3 Aug 2020 15:02:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726881AbgHCTCT (ORCPT ); Mon, 3 Aug 2020 15:02:19 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A4A8C061757 for ; Mon, 3 Aug 2020 12:02:19 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id i92so384378pje.0 for ; Mon, 03 Aug 2020 12:02:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=O6tP2dRjUFwZbhO7kTIUZzIPSMn6S/VsoDqV/IeCHas=; b=GwyGimjvlfZSm4rPZf87qz1lpYAb9Sb5zXQ8UcytIulZag6qIJXsvXyLdFFUopSqv0 /Fl1mCDdlrGtNOLSad2vl3ZlOQsuBisUBiYIQzm7JpDk1z9AjEBamBieoyh1KTMHOfZw tTglBd2CZnJo/XvFepNNiaRJ+uKZqWJnhtQBcDQTFDZJqiFuZKGXSJHh2q0IcYen5MAj +OLdSIe09Sb9neR+ZY70179YUgHipcD+bi/EBZby9k184pQbkAG1gF+JC2xh72xxod+t LO7i8FjJzU+JuKl2NXKM+BD1j8+TKX7ofkLgn1K+/f0ff8iojdwSiaSlDqhIeoReXUdu ODzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O6tP2dRjUFwZbhO7kTIUZzIPSMn6S/VsoDqV/IeCHas=; b=RUXyP6Vvlms3rLSB9rcQYlbj744nTf4KtPJBVmMjGkefMXVzFabXNrw39ZAQYwY0vA T0eQfPA+3w5NDdILl4XUuNvql3x4aOnGkVOPNUYeFWog23t3u+WMzzBTg13a7X9w0vRT Dx6VJjhtem5HBZ7GA6eIo83kVX6ygS+xF3QzgiDsZjG++0ohuTejcSei+DiiYQ23WI9S BA8yt+EE+ftPnlEHtGCf5Qq88GHoub3fEbDnD9ZeO3zEShSbhmswmlExgF/o/PjIr0h/ +J6xq83tGcKgwreLbyAd4wLwBhUM3LIjymUI3mtpyjctIsETnQg5hVzEq03hO8HIVewK RtBw== X-Gm-Message-State: AOAM5327rxg0jjcpGCTqx2u8+nacDuIWrwxw7+qXzc7kSmMdTiYZo0B9 piQ2eqsDAFPRhNmzpCfD8kD8RgPUyQM0V4UcDDRYtg== X-Received: by 2002:a17:90b:1103:: with SMTP id gi3mr726306pjb.32.1596481338531; Mon, 03 Aug 2020 12:02:18 -0700 (PDT) MIME-Version: 1.0 References: <20200731230820.1742553-1-keescook@chromium.org> <20200731230820.1742553-24-keescook@chromium.org> In-Reply-To: <20200731230820.1742553-24-keescook@chromium.org> From: Nick Desaulniers Date: Mon, 3 Aug 2020 12:02:07 -0700 Message-ID: Subject: Re: [PATCH v5 23/36] arm/build: Explicitly keep .ARM.attributes sections To: Kees Cook Cc: Thomas Gleixner , Will Deacon , Catalin Marinas , Mark Rutland , Ard Biesheuvel , Peter Collingbourne , James Morse , Borislav Petkov , Ingo Molnar , Russell King , Masahiro Yamada , Arvind Sankar , Nathan Chancellor , Arnd Bergmann , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , clang-built-linux , linux-arch , linux-efi , Linux ARM , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 31, 2020 at 4:18 PM Kees Cook wrote: > > In preparation for adding --orphan-handling=warn, explicitly keep the > .ARM.attributes section by expanding the existing ELF_DETAILS macro into > ARM_DETAILS. > > Suggested-by: Nick Desaulniers > Link: https://lore.kernel.org/lkml/CAKwvOdk-racgq5pxsoGS6Vtifbtrk5fmkmnoLxrQMaOvV0nPWw@mail.gmail.com/ > Signed-off-by: Kees Cook > --- > arch/arm/include/asm/vmlinux.lds.h | 4 ++++ > arch/arm/kernel/vmlinux-xip.lds.S | 2 +- > arch/arm/kernel/vmlinux.lds.S | 2 +- > 3 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/include/asm/vmlinux.lds.h b/arch/arm/include/asm/vmlinux.lds.h > index a08f4301b718..c4af5182ab48 100644 > --- a/arch/arm/include/asm/vmlinux.lds.h > +++ b/arch/arm/include/asm/vmlinux.lds.h > @@ -52,6 +52,10 @@ > ARM_MMU_DISCARD(*(__ex_table)) \ > COMMON_DISCARDS > > +#define ARM_DETAILS \ > + ELF_DETAILS \ > + .ARM.attributes 0 : { *(.ARM.attributes) } I had to look up what the `0` meant: https://sourceware.org/binutils/docs/ld/Output-Section-Attributes.html#Output-Section-Attributes mentions it's an "address" and https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_chapter/ld_3.html#SEC21 mentions it as "start" (an address). Unless we need those, can we drop them? (Sorry for the resulting churn that would cause). I think the NO_LOAD stuff makes more sense, but I'm curious if the kernel checks for that. > + > #define ARM_STUBS_TEXT \ > *(.gnu.warning) \ > *(.glue_7) \ > diff --git a/arch/arm/kernel/vmlinux-xip.lds.S b/arch/arm/kernel/vmlinux-xip.lds.S > index 904c31fa20ed..57fcbf55f913 100644 > --- a/arch/arm/kernel/vmlinux-xip.lds.S > +++ b/arch/arm/kernel/vmlinux-xip.lds.S > @@ -150,7 +150,7 @@ SECTIONS > _end = .; > > STABS_DEBUG > - ELF_DETAILS > + ARM_DETAILS > } > > /* > diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S > index bb950c896a67..1d3d3b599635 100644 > --- a/arch/arm/kernel/vmlinux.lds.S > +++ b/arch/arm/kernel/vmlinux.lds.S > @@ -149,7 +149,7 @@ SECTIONS > _end = .; > > STABS_DEBUG > - ELF_DETAILS > + ARM_DETAILS > } > > #ifdef CONFIG_STRICT_KERNEL_RWX > -- > 2.25.1 > -- Thanks, ~Nick Desaulniers