From patchwork Fri Oct 11 00:05:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184611 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7B4E61575 for ; Fri, 11 Oct 2019 00:06:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5CBBA22459 for ; Fri, 11 Oct 2019 00:06:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="fLT/IFk/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727700AbfJKAGs (ORCPT ); Thu, 10 Oct 2019 20:06:48 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:46852 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727651AbfJKAGg (ORCPT ); Thu, 10 Oct 2019 20:06:36 -0400 Received: by mail-pg1-f196.google.com with SMTP id b8so4670575pgm.13 for ; Thu, 10 Oct 2019 17:06:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aFfN5juCtHu18am/Lscu0/nkwdENrYqqL+l/G+SE/2I=; b=fLT/IFk/zcWpEKQQpsCuZreeSESJFRNdZ9hKHV0Y/h8n0IfaNLHOqmTYtdPHeZxkjc xWb/DQdE2uR1oDMr4EtvYElJra/mVKFp1aLbbQ6bJ3wnEDggQhIotPy3fghpdD1vLtdp EDoZ6HuknzX/OdZ89Gdo2kWzGjDi4EqKGpRbQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aFfN5juCtHu18am/Lscu0/nkwdENrYqqL+l/G+SE/2I=; b=rSwRR4Jj8TO43qOIkYKZMniQary9IeMmBXYdk00up1VHU6TgkHgxcAfBV/Hzu8nwIE OS2+NySTGQ/1+P0Hzy1kbdkIcyiPkRe+rQ0YyMeZ3pa/X84x4bun2iFOvOEWz8XHPmnu Do1YODexE0gm3u39yqLNsnJYvSpTPGGWYYoI41VKp/ZI5dA2511yP3kxf111vUl1qlEK atBSlmjffFgjiYen8YS0D0dvNjDJR1we0F12vkzUe2OgQ3/yNCWU818dEFgYs0PxPzj3 HSq29Gdc07I+yMPbIcAqzw9tYWRfMzmlkjx5AgtIKlMbYFT3VxKGDDKycqduQTDLNDtl WDig== X-Gm-Message-State: APjAAAU1jxTM45yaeZzhTPMipmeNHCYEfCnXhrLS+kXSyQgcBTejN3T6 JhP6g9s8k78X97gJ3FhzTM97gA== X-Google-Smtp-Source: APXvYqxt91xs+DlKHANMAIgcph9JiYJXmwrfwOJOztv5tZwNFPibvGy6e5lUsAYLGSGL3bBhVSlFEA== X-Received: by 2002:a63:906:: with SMTP id 6mr13901748pgj.324.1570752394983; Thu, 10 Oct 2019 17:06:34 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id f14sm10473924pfq.187.2019.10.10.17.06.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:06:32 -0700 (PDT) From: Kees Cook To: Borislav Petkov Cc: Kees Cook , Rick Edgecombe , Dave Hansen , Andy Lutomirski , Arnd Bergmann , Michael Ellerman , Heiko Carstens , Will Deacon , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.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: [PATCH v2 16/29] x86: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 10 Oct 2019 17:05:56 -0700 Message-Id: <20191011000609.29728-17-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191011000609.29728-1-keescook@chromium.org> References: <20191011000609.29728-1-keescook@chromium.org> Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org The exception table was needlessly marked executable. In preparation for execute-only memory, move the table into the RO_DATA segment via the new macro that can be used by any architectures that want to make a similar consolidation. Signed-off-by: Kees Cook --- arch/x86/kernel/vmlinux.lds.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index a1a758e25b2b..b06d6e1188de 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -22,6 +22,7 @@ #endif #define EMITS_PT_NOTE +#define RO_EXCEPTION_TABLE_ALIGN 16 #include #include @@ -145,8 +146,6 @@ SECTIONS #endif } :text = 0x9090 - EXCEPTION_TABLE(16) - /* End of text section, which should occupy whole number of pages */ _etext = .; . = ALIGN(PAGE_SIZE);