Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8488412ybn; Tue, 1 Oct 2019 08:48:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMqGcCuv3AhXXgi8/xD3VK4hKaIObOfUa1nfZggEfCG2dTNpGuvP2YYrRCTyw9VEPhqYm4 X-Received: by 2002:a17:906:48d4:: with SMTP id d20mr25063202ejt.84.1569944932085; Tue, 01 Oct 2019 08:48:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569944932; cv=none; d=google.com; s=arc-20160816; b=jXQB+HACnQWZ0Kk3hDxJ5MuYxOKE+tgwoWt2fp1brY4IwO80uKvtHe8IgaxNMh97UL P1Yiv6iJG0Uop4JtJPAVEyfEoeAbGfUXRTnZAIGeR5mm0SVqG//c5AvlNTPOU9mHO7ur O7MYcsWlU5Ly4ArrZPysalK3GotOSciDK8WTUwWz5gK93jK3b8wJwvGgyrbTHiUCbxW+ hO+p0mqJSQe2QCaALhyfHmn1qkDsJq3YQZEPtvTEStZukGof5bGzdL9LfU7TlwwqjtLI 9nKN5mbGrukJu0ZBEh8Nnee8n6EGiyOVifKyh5OkosjeUP929Igou/rQWqyEwZaLNL9S aOTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=aHMpO9J+CUbgrwJq2FPC5hQWPjIgrqNx/lVINe55yAg=; b=EUpW8lZ9FF4gv7c84ZQayklJMy0Id5LLCynl5v6U0hC40z0HOWRkNb55tGPnsi456S HE4s6gXhm8ASmbEyL5BkG3srNT1S7a1Zr7y9JEEdsYoF3f26aWndQUC/dniCOKW4pSr6 3zmpc7VfQ87He0h58uQuzus1NOJug0UG9qeE7dlR+4cKHkeb9uiVAHocbOtkSHKZ06oH H/9I5bF3MtNFLOqiaEH3eT7+xeSkI8yYf31S/sp7lWCobRWEcF/mqyGjyxqFuHAlmar4 8vdaIQwMmRQsECkesWrF51iwGS5+6TKP4NEZcex3q2nvbh0+gnkigA4E0ncUF1wb1Zq5 oDFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jpLjP0sV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c28si9668883ede.3.2019.10.01.08.48.26; Tue, 01 Oct 2019 08:48:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jpLjP0sV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S2389696AbfJAPsP (ORCPT + 99 others); Tue, 1 Oct 2019 11:48:15 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:45840 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389634AbfJAPsP (ORCPT ); Tue, 1 Oct 2019 11:48:15 -0400 Received: by mail-pf1-f194.google.com with SMTP id y72so8269929pfb.12 for ; Tue, 01 Oct 2019 08:48:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=aHMpO9J+CUbgrwJq2FPC5hQWPjIgrqNx/lVINe55yAg=; b=jpLjP0sVOqJ1io2GkUXKgc45cxfb7B1taqxOFsmCAMNJmlj5/fV9ZG/T16NITs4W9q cvbqYDNjPkgubuNgZtxJd+JdNRYNQcuTsRwBP+njU1INPXE7gYMZOi6b7xlFMKDrD14J DKcbIR540vNINUnM0FJ0c/BvYD5Gp0RtEXiDQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=aHMpO9J+CUbgrwJq2FPC5hQWPjIgrqNx/lVINe55yAg=; b=Gy7LLPE1qIw7qIAmtrgB17trV4BxoWSfG7CLzKTvbo3Hddw053uzckJqc9er5q0kMx mM114bDcx13072erb8fWankOQLNymaW5YXVVbiLevfXmGDMAcNf8Z4mZRliQmN1ZPXu+ AG4yFmestVHPuwX1ag9f7pEolpFlq48UYmkUB9dFsXR2G4h7Sc1Gzo0yX8iZkr3CIlPQ KiNCDWpVhu8HMWFbLnoKULpoS5UKd0IxwZ4AdExXEdyfWh4tf7YxQrywUnwz0kT6Baec MfYY6W48t1UwmFYVrUNdYVc8XS6X0VhlzkZ6YRFzaoBsuhX47XKPCGVJCCRtfa5ikB1g Hp8A== X-Gm-Message-State: APjAAAXKwXD3uNGr6jDVF4+uc7GmBDKrmR9B8IrKZdSf14HiZ3t1ETln 4YLYdQF9esYLvpaUHY6fxFJJ/g== X-Received: by 2002:a62:14c2:: with SMTP id 185mr27818394pfu.47.1569944893417; Tue, 01 Oct 2019 08:48:13 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id x18sm1559678pge.76.2019.10.01.08.48.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2019 08:48:12 -0700 (PDT) Date: Tue, 1 Oct 2019 08:48:11 -0700 From: Kees Cook To: Will Deacon Cc: Thomas Gleixner , Rick Edgecombe , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Dave Hansen , Andy Lutomirski , Arnd Bergmann , linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org, Yoshinori Sato , Michal Simek , linux-parisc@vger.kernel.org, linux-xtensa@linux-xtensa.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 18/29] arm64: Move EXCEPTION_TABLE to RO_DATA segment Message-ID: <201910010846.D0712C1@keescook> References: <20190926175602.33098-1-keescook@chromium.org> <20190926175602.33098-19-keescook@chromium.org> <20191001090355.blnaqlf4rfzucpb2@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191001090355.blnaqlf4rfzucpb2@willie-the-truck> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 01, 2019 at 10:03:56AM +0100, Will Deacon wrote: > Hi Kees, > > On Thu, Sep 26, 2019 at 10:55:51AM -0700, Kees Cook wrote: > > The EXCEPTION_TABLE is read-only, so collapse it into RO_DATA. > > > > Signed-off-by: Kees Cook > > --- > > arch/arm64/kernel/vmlinux.lds.S | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S > > index 81d94e371c95..c6ba2eee0ee8 100644 > > --- a/arch/arm64/kernel/vmlinux.lds.S > > +++ b/arch/arm64/kernel/vmlinux.lds.S > > @@ -5,6 +5,8 @@ > > * Written by Martin Mares > > */ > > > > +#define RO_DATA_EXCEPTION_TABLE_ALIGN 8 > > + > > #include > > #include > > #include > > @@ -135,8 +137,8 @@ SECTIONS > > . = ALIGN(SEGMENT_ALIGN); > > _etext = .; /* End of text section */ > > > > - RO_DATA(PAGE_SIZE) /* everything from this point to */ > > - EXCEPTION_TABLE(8) /* __init_begin will be marked RO NX */ > > + /* everything from this point to __init_begin will be marked RO NX */ > > + RO_DATA(PAGE_SIZE) > > > > . = ALIGN(PAGE_SIZE); > > Do you reckon it would be worth merging this last ALIGN directive into the > RO_DATA definition too? Given that we want to map the thing read-only, it > really has to be aligned either side. Actually, taking a closer look, this appears to be redundant: RO_DATA() ends with: . = ALIGN(align) (where "align" is the "PAGE_SIZE" argument to RO_DATA()) > Anyway, that's only a nit, so: > > Acked-by: Will Deacon Thanks! > P.S. Please CC the arm64 maintainers on arm64 patches -- I nearly missed > this one! Okay, I can re-expand my list. I originally had done this but it was getting to be a rather large set of people. :) -- Kees Cook