From patchwork Fri Oct 11 00:05:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184641 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 634E1139A for ; Fri, 11 Oct 2019 00:07:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 180B621920 for ; Fri, 11 Oct 2019 00:07:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kQ82BkHI"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="fUPnxPNk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 180B621920 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=oCY6t64QZKyQxVxxqUyeYQG+2w+lM9wBzyDzxS194tk=; b=kQ82BkHIHg1rdX1PCrZ+oHtREK xbCC4HMZjV1pnuucBhk4I3+/szvPkgFVyQFfgTRtIYbDLSpxT+RCJAm8pM0SzAMSC/Q/6dgKpZ0e/ B3jEyh/AqOe02V+2pxH6a4L+LX2J8bpyV2u+g7mbrp9tZoS2VxWyq1qcP+Hzigy+l5soUH0OhRlkw 74Z2rQ+BV1ERzmHUeLTIEs27N44FpDuzVQ/rASxRm7n8drPW/LGzj5kYN5//pe+CjxLcU4qviI70O HsFTsM2wckNffzrmHj2U+TXHYro86rc8nWoqsB+8z38C3yyPgbK8OTKP4AL+nkluq7bfNpMEmSg3B x+hc0AYA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiTB-0004dE-TQ; Fri, 11 Oct 2019 00:07:45 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiRs-0003Wq-Sa for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:06:26 +0000 Received: by mail-pg1-x542.google.com with SMTP id z12so4688878pgp.9 for ; Thu, 10 Oct 2019 17:06:24 -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=WqLTzjTdYtu13eBI1Hsh3syPKd5R5C/bZSENvznkqN8=; b=fUPnxPNkLbKz79eLdwRoDJjW70ASz4RGYombh+MpItuFQQCQWGWcKvPqy4gl6E62bz YXcrXM4MjXChDuBwxAdJsCaz9rjKO2RPeC3DbmTKU7AZ15ypootuMHyTiE2LYXks+fRY MfiZIZu5Q++w2SE3zrFSij8n4HmJ+XDt2oi0w= 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=WqLTzjTdYtu13eBI1Hsh3syPKd5R5C/bZSENvznkqN8=; b=QSjfl0NKRobXEIXG2Sn0wabcPWCezuH3ERT2692GCVaRvposEwBa11C3DN53wIS5/8 FvMmj/nDl3OIxO38ASzBL/GDWmtnKUS2be4sd5MsFIy2I2JfMbpamoPhx40hohLVIhn+ kUStITVCk52edNlFAkT+SFBurHWdkuzhD1ZmeZeNh8h99SVnH/fX2MSrxXjYY0bFGxHk O2hLQmmAGGjhex8Kn+bDSdPvH96oO6iwTDM3zTMfRzQas8NZBlPiHxpAzmICxkzF7Nnq XQJTMkADltkksCAdCuairA+p+4pt6io+scbHt02hNVk88/UDpS3T2pL0iiIEY5fWcL15 8TPg== X-Gm-Message-State: APjAAAWbDDao+hcJuQy6RhcY3AGsbSfCzie7cuYTx1SQyoRz8phUUIV/ BPMteGY24S565Yy310PKaRRhag== X-Google-Smtp-Source: APXvYqwSvIKQzn0Wh29UPciSLsyXo4RVbmYIVzpELs7182W3aoZycw+TLoXbSJd3JfRFzRbTSmYlrw== X-Received: by 2002:a63:fb0a:: with SMTP id o10mr13787651pgh.258.1570752384285; Thu, 10 Oct 2019 17:06:24 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id e192sm9402924pfh.83.2019.10.10.17.06.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:06:20 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 01/29] powerpc: Rename "notes" PT_NOTE to "note" Date: Thu, 10 Oct 2019 17:05:41 -0700 Message-Id: <20191011000609.29728-2-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_170624_928976_DC768D85 X-CRM114-Status: GOOD ( 12.20 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:542 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The Program Header identifiers are internal to the linker scripts. In preparation for moving the NOTES segment declaration into RO_DATA, standardize the identifier for the PT_NOTE entry to "note" as used by all other architectures that emit PT_NOTE. Signed-off-by: Kees Cook Acked-by: Michael Ellerman --- arch/powerpc/kernel/vmlinux.lds.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index 060a1acd7c6d..81e672654789 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -19,7 +19,7 @@ ENTRY(_stext) PHDRS { kernel PT_LOAD FLAGS(7); /* RWX */ - notes PT_NOTE FLAGS(0); + note PT_NOTE FLAGS(0); dummy PT_NOTE FLAGS(0); /* binutils < 2.18 has a bug that makes it misbehave when taking an @@ -177,7 +177,7 @@ SECTIONS #endif EXCEPTION_TABLE(0) - NOTES :kernel :notes + NOTES :kernel :note /* The dummy segment contents for the bug workaround mentioned above near PHDRS. */ From patchwork Fri Oct 11 00:05:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184599 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 DBF191575 for ; Fri, 11 Oct 2019 00:06:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B808A21D7C for ; Fri, 11 Oct 2019 00:06:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="j4JbJueX"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Zkm/RKe8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B808A21D7C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=gPXpte/eLuMehVuOyzpUe0Z7JNyx7IhMP8l3XDaktVg=; b=j4JbJueXqsGqnyilMiQYtpcnpn 0Uj7qftqCRa7+/a9Zg9ocCOv9355RSp9b510Wmh+I6mCkAlFm1K4L+wDyYIBSHCYLIckxyYZmHRVw o61hrm8k/QXx5cOC/HJ6JkMagLQlj8/r3Cvv1Pm1w1f5cGlp7yjTph1zpSJTN+BQDhyxbFDaVoi7e MfJ981QjV2Wxe4tFEEHUHHOxjE86jkd/TOr7hzvV6ZeRI1FwTvXZyOKalPiHqsLjDgnRFGluJhktA icut8o4rqZbnucaPfpqjTXTluWF/Ix6/2SH1CyW0k6tJ5lUKdo3Vio+Gc54ShvZ6pv4yAnvtSFVnK EsUvcBWg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiRs-0003WX-L2; Fri, 11 Oct 2019 00:06:24 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiRq-0003Vi-8K for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:06:23 +0000 Received: by mail-pg1-x544.google.com with SMTP id b8so4670227pgm.13 for ; Thu, 10 Oct 2019 17:06:22 -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=7dmckIaKuL5uoyVhYLyxQgvD7laB8s0ddXfS7YNycCU=; b=Zkm/RKe8e+Liv+qZ7ZPm9kwWeSr+NIaspEW7t3lmnI5dNpUpSo6dTzux6vNvY1O0iZ mXmbpcaYzINbphQms11pCzDFWcPo5ulCRYCfFRW5DOq8KNnHUZoPg9cYONZAaxdOzKmE WYECp/MY1nFT0o4uteh9HzWwnmK7DhrJcJDFU= 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=7dmckIaKuL5uoyVhYLyxQgvD7laB8s0ddXfS7YNycCU=; b=RaI+IUo2w0sJMy4l2kIQuVzpd1wg4TrUA0up9/Nk1q6YEXkdFCjhFtT1xaVWEJFTk6 WRCTmM+3ySs3Pusqm6oDVflrdd7xRISE7FCnZvDtACXBaOxusQ48hzG7ACjoip+80cOC wZ0uiovWltQAd5tXGeOjspTdc7OKowk/UaNW1n4C205W5dEcIEN5ubZwGhPd0kKEky7r RDgZgdtrsfN+SJYvSgzHZ4nyurq5aLVUV8dvXtApa5daYUocCEEVoTd67Fy31g4y/Iyn NAYpfxbNKYeiWqEJ08DvUfCrv5HDtzg6Sl9p8FXKm787eXylPB2Cg/BT5bdcYB0CvVqw ICBQ== X-Gm-Message-State: APjAAAVxJlNoL6i4tn7AOR/tXuFaD2WJWsPaxDez123sEb0bgIPQrVo8 GCHWQCP8RqZ7rD/iiF5y2uN7cQ== X-Google-Smtp-Source: APXvYqy8lBsu/lNnf25rns+8k/zkBM8oQHwDv9L6rfwj03NX/IG4fGJ+vORVfGqdbtbZOe/1C8n/Lw== X-Received: by 2002:a63:554b:: with SMTP id f11mr13613094pgm.151.1570752381593; Thu, 10 Oct 2019 17:06:21 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id o42sm12777771pjo.32.2019.10.10.17.06.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:06:20 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 02/29] powerpc: Remove PT_NOTE workaround Date: Thu, 10 Oct 2019 17:05:42 -0700 Message-Id: <20191011000609.29728-3-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_170622_320365_8104F0F2 X-CRM114-Status: GOOD ( 12.87 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:544 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In preparation for moving NOTES into RO_DATA, remove the PT_NOTE workaround since the kernel requires at least gcc 4.6 now. Signed-off-by: Kees Cook Acked-by: Michael Ellerman --- arch/powerpc/kernel/vmlinux.lds.S | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index 81e672654789..a3c8492b2b19 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -20,20 +20,6 @@ ENTRY(_stext) PHDRS { kernel PT_LOAD FLAGS(7); /* RWX */ note PT_NOTE FLAGS(0); - dummy PT_NOTE FLAGS(0); - - /* binutils < 2.18 has a bug that makes it misbehave when taking an - ELF file with all segments at load address 0 as input. This - happens when running "strip" on vmlinux, because of the AT() magic - in this linker script. People using GCC >= 4.2 won't run into - this problem, because the "build-id" support will put some data - into the "notes" segment (at a non-zero load address). - - To work around this, we force some data into both the "dummy" - segment and the kernel segment, so the dummy segment will get a - non-zero load address. It's not enough to always create the - "notes" segment, since if nothing gets assigned to it, its load - address will be zero. */ } #ifdef CONFIG_PPC64 @@ -178,14 +164,8 @@ SECTIONS EXCEPTION_TABLE(0) NOTES :kernel :note - - /* The dummy segment contents for the bug workaround mentioned above - near PHDRS. */ - .dummy : AT(ADDR(.dummy) - LOAD_OFFSET) { - LONG(0) - LONG(0) - LONG(0) - } :kernel :dummy + /* Restore program header away from PT_NOTE. */ + .dummy : { *(.dummy) } :kernel /* * Init sections discarded at runtime From patchwork Fri Oct 11 00:05:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184635 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 6F480139A for ; Fri, 11 Oct 2019 00:07:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4CCD921920 for ; Fri, 11 Oct 2019 00:07:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NUzWXHI2"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="crQ1Wv7y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4CCD921920 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=1KGnGHraQWBbxs1Ch1iG9NuWi8p1uddmOjdvHfQKuRo=; b=NUzWXHI2cK5+KO2+XThBqOJ+em xWpJFPSen2w3jYhUBLCFbqecrYpHcpIAvECTB95UUjXLghCXkk15WEA3Ij7JJEHlKJT35uQ+UH8WY nMaM8QFspqqmFXVJiPNOr3hoWiwGFX2njF9LCo1CIxVrVNA5Z7LqDUnCrX/EzZqbfsr5fXKqG4FgQ xrUgp8Hj6WRM402P4nvwJvrVDVpOwXzmOxf1Y762KXuIvBrQ1o8KDHqMzr+7egR26On/68jC8BXLD CBal8cRuAZZR0Lwa4/SNM3ObRsfy8uGi9vB4rHp2eeYuwunlVkjafE661Q6KkwfiAU1lLV3GmOR6Q WjGkytTQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiSy-0004Pk-Tq; Fri, 11 Oct 2019 00:07:32 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiRs-0003WY-KQ for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:06:26 +0000 Received: by mail-pf1-x444.google.com with SMTP id q12so4935734pff.9 for ; Thu, 10 Oct 2019 17:06:24 -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=ObCdg+imqB9G1d842Lgck/VSTqVGl2xoAH4cm4FkKow=; b=crQ1Wv7yU8u6QDGlDwBktMC8ID6kd2jR2ktjlIEg9lNMaYkSGp+vVyfOhN5n/bbb4w tpNmt7wW87sAgB/gHBbhR1BwKIxx8HWLuqxVFsB9sj+yjEeBVLxwYKqP8+nT6ULOb4qs C5n7z+PSjnqWQlNXFQHms0qNFflOzMMUW6V2Y= 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=ObCdg+imqB9G1d842Lgck/VSTqVGl2xoAH4cm4FkKow=; b=j1/AkJmZPr+tBwAzbgcFqD8kxYejth/SzLou77dVbG07PaIzZMrPlNFrZmVfSkoh80 X+FuE3oKXrST1wfu2r3siG5nkWY8weOboh6OJYwMLOgj6fyUpsweT1pRpTPQ5wmU4uTv lZTbdPehh+H1zRtIjfamsMkrfltINmvgJFVQpJjv8qx8Q2dtAPyl9FPHKLgh5DP/2SzP HEN5cusB+nOoouhEU5nH/vPlhMsG+fBHNWAxTXjbGYHjhFIjG+9UjPaMdSnULy7mg2mF UpPW5yOFlR4j0PsmqQKddLEY64xmikZoTdp7xr/NFFjkcqZRjVatwwdUWXtz0/9cwIRX lHyA== X-Gm-Message-State: APjAAAWuSyM5E2TZhvtBXqJz2AOpFiDqWEYQe69zNugsoNPmVlhXuogK ZXigofgFDobaz1nB5nImT8fzIg== X-Google-Smtp-Source: APXvYqx+lfPTpnvfcuRRBeqTz2GN8uCmPc7RnUYQGVmNn2nMH+aP0xZQtQocoZFSsUHXgigJlUoJog== X-Received: by 2002:a63:fb0a:: with SMTP id o10mr13787560pgh.258.1570752382982; Thu, 10 Oct 2019 17:06:22 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id k23sm9231444pgi.49.2019.10.10.17.06.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:06:20 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 03/29] powerpc: Rename PT_LOAD identifier "kernel" to "text" Date: Thu, 10 Oct 2019 17:05:43 -0700 Message-Id: <20191011000609.29728-4-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_170624_713397_147A617D X-CRM114-Status: GOOD ( 11.66 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In preparation for moving NOTES into RO_DATA, rename the linker script internal identifier for the PT_LOAD Program Header from "kernel" to "text" to match other architectures. Signed-off-by: Kees Cook Acked-by: Michael Ellerman --- arch/powerpc/kernel/vmlinux.lds.S | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index a3c8492b2b19..e184a63aa5b0 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -18,7 +18,7 @@ ENTRY(_stext) PHDRS { - kernel PT_LOAD FLAGS(7); /* RWX */ + text PT_LOAD FLAGS(7); /* RWX */ note PT_NOTE FLAGS(0); } @@ -63,7 +63,7 @@ SECTIONS #else /* !CONFIG_PPC64 */ HEAD_TEXT #endif - } :kernel + } :text __head_end = .; @@ -112,7 +112,7 @@ SECTIONS __got2_end = .; #endif /* CONFIG_PPC32 */ - } :kernel + } :text . = ALIGN(ETEXT_ALIGN_SIZE); _etext = .; @@ -163,9 +163,9 @@ SECTIONS #endif EXCEPTION_TABLE(0) - NOTES :kernel :note + NOTES :text :note /* Restore program header away from PT_NOTE. */ - .dummy : { *(.dummy) } :kernel + .dummy : { *(.dummy) } :text /* * Init sections discarded at runtime @@ -180,7 +180,7 @@ SECTIONS #ifdef CONFIG_PPC64 *(.tramp.ftrace.init); #endif - } :kernel + } :text /* .exit.text is discarded at runtime, not link time, * to deal with references from __bug_table From patchwork Fri Oct 11 00:05:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184625 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 857B71864 for ; Fri, 11 Oct 2019 00:07:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3D58721920 for ; Fri, 11 Oct 2019 00:07:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="j1jjHvEL"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="TBJeuKMY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D58721920 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=kF99M32f5ai8H6vNoNsfnkrybMiBNCtES5cP7r9/HMg=; b=j1jjHvELqyszhbYXFqxJUmmaze VXGzflkYFipnOokJGJ5VBYfhrRyYxRb+gYeLxhAr3F/00cBptKl1jn6WFR3oAQtt3S4OpnVb+haOl otc+ima1Er+ZJzolYcGml/QwsUFJ9ptW0pGCDBtTHHwDS6tU7UzndUM36QA6HV8eUJg0AoWRKpXTP paUJ4wkPSPsWCltrYJLLMnmR4k0Fo7qjSy++/uX86IGKjS8E8QrpNhJ4tjhZWXZW0hAYB1XCd6S2C F34PFKp0jFV57MhnVqfOP1TrsOMrvcdnbZ+RR9opdNdaaCDoSFqeWlvP7RNc7QwMORiwK879WE2wl 503swc9A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiSf-00042V-2y; Fri, 11 Oct 2019 00:07:13 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiRs-0003WJ-4c for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:06:25 +0000 Received: by mail-pg1-x542.google.com with SMTP id x10so4692063pgi.5 for ; Thu, 10 Oct 2019 17:06:24 -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=7MxClQbH59XRrbTRajW1Gh8uACzcU2+htsVcXyM7D1g=; b=TBJeuKMY2z8zTRQ1bFw/ImZS5YFoYQAHk+uSCJMry9jQKOeGheQ5i7gXGHU01GWcTB uOgoFqPErAXZia+mP12x9qnkRfY1Ys9PjUB5SmB5We4kWHLZQ5n99yhQi0dIKcFUZu6/ hILLkVhE9upOn1PuRtaesOlh4SL00TV9kLm5U= 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=7MxClQbH59XRrbTRajW1Gh8uACzcU2+htsVcXyM7D1g=; b=Hj9yE8UoLYU2OttcHYRrmgFVIYFjeH2Q4eD/C66pMl46ShwsXhEelriKcU0hBAHwN2 NAtDsepESCtkr9GGgc2Pw/v0GFeUd5NSwCd+DTJbkt4DQho3Oa7LZcu2dpq3Bovz8PYu u+0ww6xyKQaWbEi8hMfnvxk3m31Xxe0/AcFyqKxZL8zIFywtsDhAcwB0rpXCv8PBjQRl 1yK76huFgy+q9yAUdWmR7R2p/oUlZSM3z33fJkvn0yIgf0gDuN3gn7v97/5OWqiZJql+ t9AtJu51vYrwT9LZ73IJ6Y7vNRSaGq27ctMNyulQZ6YK8iCmJ3dCc78vnvkzZt4tJKDr gbfQ== X-Gm-Message-State: APjAAAVBR8tXAqn6CCRM2X6QQI6qWTG8x+cokhDxrptEo0q6wSo+S1qR vIWtvvQYd8iQHA8y6Fj8FgLjsA== X-Google-Smtp-Source: APXvYqwg7IWyK5GALjp45zOGgCtbjryTtA5MoWvVIZiHDTE9GJEt+Ue8rYJCs4VD37qrCGGbQgqtBg== X-Received: by 2002:a62:5bc1:: with SMTP id p184mr12930072pfb.180.1570752383534; Thu, 10 Oct 2019 17:06:23 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id d5sm5372814pjw.31.2019.10.10.17.06.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:06:20 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 04/29] alpha: Rename PT_LOAD identifier "kernel" to "text" Date: Thu, 10 Oct 2019 17:05:44 -0700 Message-Id: <20191011000609.29728-5-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_170624_177755_8151CD8D X-CRM114-Status: GOOD ( 10.97 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:542 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In preparation for moving NOTES into RO_DATA, rename the linker script internal identifier for the PT_LOAD Program Header from "kernel" to "text" to match other architectures. Signed-off-by: Kees Cook --- arch/alpha/kernel/vmlinux.lds.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S index c4b5ceceab52..781090cacc96 100644 --- a/arch/alpha/kernel/vmlinux.lds.S +++ b/arch/alpha/kernel/vmlinux.lds.S @@ -8,7 +8,7 @@ OUTPUT_FORMAT("elf64-alpha") OUTPUT_ARCH(alpha) ENTRY(__start) -PHDRS { kernel PT_LOAD; note PT_NOTE; } +PHDRS { text PT_LOAD; note PT_NOTE; } jiffies = jiffies_64; SECTIONS { @@ -27,14 +27,14 @@ SECTIONS LOCK_TEXT *(.fixup) *(.gnu.warning) - } :kernel + } :text swapper_pg_dir = SWAPPER_PGD; _etext = .; /* End of text section */ - NOTES :kernel :note + NOTES :text :note .dummy : { *(.dummy) - } :kernel + } :text RODATA EXCEPTION_TABLE(16) From patchwork Fri Oct 11 00:05:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184643 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 BDA9E1575 for ; Fri, 11 Oct 2019 00:07:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9A87C214E0 for ; Fri, 11 Oct 2019 00:07:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SFHAHPYm"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="h/B19WCk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A87C214E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=S7odTwaCFULHUrqPK1FgNb5O5FoT8J0mF/w3Jbc8jnY=; b=SFHAHPYmw+sLaz8GGZRRFc/ec1 9Sil1oIB47SEmanhQXKZdG55kG7KecAviGwD7us4PTYBtsm8JS30/JyOYlCT2KX5rnIHtdYwGKSOF ejNPpC41rqo3JCH+LC5g20B3WUScqRl13odUrG1sOs6XPlhSVZyNBm+JBtBwxMmLCcux2j3e9MZGL wZ5cv/xz9Ol6YHJf45nV4aYrGT9G4VHKt3c8Rqrjg4NyG6fPD3MsEfL3Bm2eZLLzE+Sq7gDegDbrU Sgcd1N/NhC7vNiSPq2u8DkzA1mxYeF+xPWRWTr+8y3QW4qWMgK5pzJpOduOJEkN8gBxoyzuUPNu1z l9/bzvsA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiTO-0004qA-DS; Fri, 11 Oct 2019 00:07:58 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiRu-0003YD-JF for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:06:28 +0000 Received: by mail-pg1-x543.google.com with SMTP id i32so4682995pgl.10 for ; Thu, 10 Oct 2019 17:06:26 -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=9QIZQEEx86BzYrPbnl0U6tW2XkUfCUBHfootbZQ3f/s=; b=h/B19WCkyL+xymsA4HFl8hqcGsybKIgVl1/uhhhVSgPKYo6NP7vZ5rRibvBcc9cHi0 dKUj61YWLvd6Paq9o21PGCwAwApZ0KSVPAqMWPWlFGYXaNSsjI/dS7B2W11htDcOzgnE DitiicKTEnEB0ngjDQf+AmKVkG49ZOcGoE0gQ= 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=9QIZQEEx86BzYrPbnl0U6tW2XkUfCUBHfootbZQ3f/s=; b=FDBKak6pCGK0K8J502BGoromzauyGPDknIar7yampMOrNwUj5w3HYgZ8UxjL051ZuO xBZuqYZA5xkwoAecgaSrBimWjwnCfQoyHUOOvznsrrfXa5P3/JEpG/85hjl3etEUCasN LlNyxcq4+WhtnIN8fCEpHwsk+++pMkc7J4tHBu/2F10GLU7RdR96G2ob2fwBLLGba3wl /dzg/iaGLv/y1yde0ApBqF4C6mNJLUQKBbdqBK1pUvrbBK53M7iz6Dk3/Z4Pf5CbLRmU uwBFnHu5e3cIZM6VThSfi3QLeEgNpG1t9wJ1S+mFotQnAeqK6bNaaA0+HpaprQss/egv IYqw== X-Gm-Message-State: APjAAAU1J70L9XqjT2pKB6BaSKwnwyNXWMAdc/jsKz2HoWw0bZLKe4Q6 EmcsYmNMNzuvQrrU9/r6CNIlxg== X-Google-Smtp-Source: APXvYqx4W7fel1DIaEF8YA2JM9DuPiq7TPvvITPEvxb/fDK3Ll5VL5/FYyAVhRaQT1eulT76dS3lTQ== X-Received: by 2002:a62:3387:: with SMTP id z129mr13444661pfz.185.1570752385625; Thu, 10 Oct 2019 17:06:25 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id 127sm8449250pfw.6.2019.10.10.17.06.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:06:24 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 05/29] ia64: Rename PT_LOAD identifier "code" to "text" Date: Thu, 10 Oct 2019 17:05:45 -0700 Message-Id: <20191011000609.29728-6-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_170626_656136_18E9F643 X-CRM114-Status: GOOD ( 11.73 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:543 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In preparation for moving NOTES into RO_DATA, rename the linker script internal identifier for the PT_LOAD Program Header from "code" to "text" to match other architectures. Signed-off-by: Kees Cook --- arch/ia64/kernel/vmlinux.lds.S | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S index d9d4e21107cd..2c4f23c390ad 100644 --- a/arch/ia64/kernel/vmlinux.lds.S +++ b/arch/ia64/kernel/vmlinux.lds.S @@ -13,7 +13,7 @@ ENTRY(phys_start) jiffies = jiffies_64; PHDRS { - code PT_LOAD; + text PT_LOAD; percpu PT_LOAD; data PT_LOAD; note PT_NOTE; @@ -36,7 +36,7 @@ SECTIONS { phys_start = _start - LOAD_OFFSET; code : { - } :code + } :text . = KERNEL_START; _text = .; @@ -68,9 +68,9 @@ SECTIONS { /* * Read-only data */ - NOTES :code :note /* put .notes in text and mark in PT_NOTE */ + NOTES :text :note /* put .notes in text and mark in PT_NOTE */ code_continues : { - } : code /* switch back to regular program... */ + } :text /* switch back to regular program... */ EXCEPTION_TABLE(16) @@ -102,9 +102,9 @@ SECTIONS { __start_unwind = .; *(.IA_64.unwind*) __end_unwind = .; - } :code :unwind + } :text :unwind code_continues2 : { - } : code + } :text RODATA @@ -214,7 +214,7 @@ SECTIONS { _end = .; code : { - } :code + } :text STABS_DEBUG DWARF_DEBUG From patchwork Fri Oct 11 00:05:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184645 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 7BC37139A for ; Fri, 11 Oct 2019 00:08:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 59B9321920 for ; Fri, 11 Oct 2019 00:08:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WGSqGIFB"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="MPX+iPje" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 59B9321920 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=HwSQvjcG1WWjoQkd+gjKEkGGfF6QWxuyH+v0mzcanHg=; b=WGSqGIFBfoB4Q4oJqt/fXD/0Xo walTCvuQ7x+aRcdv9D/mFzZ1bfgufGgDg9hHuv+q3jeyt+g/vXdLfD6iOd0RgzkHjMQTAJjdLPvxv PZWYZsGzJh0xze7c8unvizIcgJuS0KTd6Ipy0b6UcRfGLgdz1/3y89hOm50jUovkrMyoxWyFTJ9R2 Bjblfki5qonyh1h5QhTwyKegQmQZc34cQWteVg/O0btAQNmAe+2uZdhL3zBH5ScllnknQYdF0nlXY pLRHhQ+0sJSE7QEHnt2a1NpNBfH9x9TX+51n0ij500RtJVVBJa8h1bHn16oVfu3kc2MPFGax7OTCC Q9CLQMFw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiTd-00054y-3s; Fri, 11 Oct 2019 00:08:13 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiRv-0003Z4-5Z for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:06:28 +0000 Received: by mail-pg1-x543.google.com with SMTP id e1so4695226pgj.6 for ; Thu, 10 Oct 2019 17:06:26 -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=bl12US5Yp4ZwWvaEnQTrcBCg3LoqQRPWnxt7WskOqWM=; b=MPX+iPjeGRBi9W7v8BaGtEQ7Z0gPfVJ+oEGukA1Qx5FZM3UbvHSgUUNTtJdbrvF0DJ Lniffb/JdJpDuc2hFDvI6xqzg3lDsRa6goVJDwHcZqncxHEEePqIwXD0wmcvebpFmc8f hOMnZpwmNvMPGn7QBG585RWKNTpfnKyDCS46Y= 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=bl12US5Yp4ZwWvaEnQTrcBCg3LoqQRPWnxt7WskOqWM=; b=RNaTZe42oU53MgC3yWKMyzvMHL0S4EVpDCH8zqlOFTgHpYpGi3/MajpqJ0gp/ym2wk iIvkYwGyxTF84yCVrrtnJ1zILwZ/nfffOubObpkeUM/vI/mvcUMmGmgDtrNAAG0EGk8K uu+SOzfIV7ZbmjtN8UK5kNImVKA7p9hURKKpIpzUKrzxKXXSUg+D/nkeCNF2Zg/S9YF+ cMJS2v4dAFD15r1ZM6OesUqEx67K6fQby3UugtNZO8D0JBln9pe6a0KJx6Y3bdueutMw CG40fNFt7cUx4NjALlAzxArhUg6L7AzrymhHIGhujNwswZEJVk9QZsCiXPkaAiki4yVy mi5w== X-Gm-Message-State: APjAAAWPim8HcTIZ63r3BKkIliVgmCqIeom1VgvBXPC71WFxI1ooH7T7 8WPi7f8zGsAXHOr9NdZBI6yqtA== X-Google-Smtp-Source: APXvYqx/QRL/EGj1UNqOw9cSZc5qNyXaSBqEdm+ZR6Z42olkPMiWXRzScwFI4gnTT7Nu98OPft+Atg== X-Received: by 2002:a17:90a:9318:: with SMTP id p24mr14062359pjo.31.1570752386117; Thu, 10 Oct 2019 17:06:26 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id 6sm10807049pfa.162.2019.10.10.17.06.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:06:24 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 06/29] s390: Move RO_DATA into "text" PT_LOAD Program Header Date: Thu, 10 Oct 2019 17:05:46 -0700 Message-Id: <20191011000609.29728-7-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_170627_325808_F530A4AD X-CRM114-Status: GOOD ( 11.16 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:543 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In preparation for moving NOTES into RO_DATA, move RO_DATA back into the "text" PT_LOAD Program Header, as done with other architectures. The "data" PT_LOAD now starts with the writable data section. Signed-off-by: Kees Cook Acked-by: Heiko Carstens --- arch/s390/kernel/vmlinux.lds.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S index 7e0eb4020917..13294fef473e 100644 --- a/arch/s390/kernel/vmlinux.lds.S +++ b/arch/s390/kernel/vmlinux.lds.S @@ -52,7 +52,7 @@ SECTIONS NOTES :text :note - .dummy : { *(.dummy) } :data + .dummy : { *(.dummy) } :text RO_DATA_SECTION(PAGE_SIZE) @@ -64,7 +64,7 @@ SECTIONS .data..ro_after_init : { *(.data..ro_after_init) JUMP_TABLE_DATA - } + } :data EXCEPTION_TABLE(16) . = ALIGN(PAGE_SIZE); __end_ro_after_init = .; From patchwork Fri Oct 11 00:05:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184647 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 2594C139A for ; Fri, 11 Oct 2019 00:08:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F3079214E0 for ; Fri, 11 Oct 2019 00:08:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fKWBQPcX"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="GHJrn0r8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F3079214E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=FHYEPfowEET14HZnaGn8K7+zASZ25X0zbhitQOHPoZk=; b=fKWBQPcX3EI7eX/P93cZq+rcsG XsP5GpV9QO0AdzCBIHuOVBMMhQKvzv+uWuRWcKdUVtKmhuqRxdk/PH84eaFBQdPboFBb6qR9MbUxT fgYwftmKQnE84Caf9DH1Gb1/08IDnnMA429PX6Lk8PYzYNvkA4gRiGyG5xcyvA8q93uvaxMoOANIn vCcGQyFCEsPJ3BvoUuqx8J0xWnb6/nQlPKMtDLLVX/14XWSH24WS5jGgT5kOc/eKHfyeVW/4/bft2 Nah71k6hqOmiDcZUCQkpNpTNW/+t4rp5TISr7Tqq9x/phUzFzD41n/kVZzyCQ2qB/iXKoqCJQMiPo JvUNmkhw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiTq-0005JW-DS; Fri, 11 Oct 2019 00:08:26 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiRv-0003ZZ-Jq for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:06:29 +0000 Received: by mail-pf1-x442.google.com with SMTP id x127so4939842pfb.7 for ; Thu, 10 Oct 2019 17:06:27 -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=/BlCq1vuoPK6b90i9+3dEN0gsbsUxI5XzRVDtU+Y9n4=; b=GHJrn0r8p4QDRypis6WzxDqJLjyLzu0c9DD31onEhaU6MLFCbVj+PFhPVkLaKrLr36 6/jJ7OuoXZWX6LGkizVGzJHGBfhDDMvBdX6JasWlhwE3Pz+fa+29g8GSrJ2HxibXscDy XREgc77JYPHoKnPPc/FC6vHKtCm5+OUHsSdmQ= 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=/BlCq1vuoPK6b90i9+3dEN0gsbsUxI5XzRVDtU+Y9n4=; b=M54ub7xlSZ5snPKfXQ96WIYpdmGYuCKJhdIkOSdXa1NtFGXf2xtzZWZFydR4ox24Fc 2z11rcE3BCvI2gtnU6OTZ2i1hOEOCIHmkJgzHAzhzhZJEOrOYgsJEoNcsWJ4E8545s20 5AS6Lxx639ix5yMXIi+uVFO25L3mbIzNBCkm5Vt1tzeiJTTC55lhYGQrM2DU8ZFLpgOV 8zQnh9TaqeFAWk2UWmdTbCx9Nfcm9uIo03xMOynzYe3lhh3rlI4dwXe8mH+GihSX/Oxf BhtHTIRodYGH204+dAS5sjV6Q/La24ioINXWDf2cdyI0QqY0b0h0yTKSZgRkpNb32gPW foMw== X-Gm-Message-State: APjAAAVtalG0U614jKpNHWXGoZxjvJ5D8CGYeCijCh7VGux6uZYH67ye vP+bpMxnY/x5RgrNM1XSq+JFOg== X-Google-Smtp-Source: APXvYqxm1QyOZv5u+41ebuDjigq/RdhkNKyMk/fjtAY65tjxQi2WIaaeC50vP1uynwiInzpzpev47Q== X-Received: by 2002:a63:5c07:: with SMTP id q7mr13867865pgb.294.1570752386631; Thu, 10 Oct 2019 17:06:26 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id h2sm7642311pfq.108.2019.10.10.17.06.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:06:24 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 07/29] x86: Restore "text" Program Header with dummy section Date: Thu, 10 Oct 2019 17:05:47 -0700 Message-Id: <20191011000609.29728-8-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_170627_671591_AF98B0CD X-CRM114-Status: GOOD ( 13.31 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In a linker script, if once places a section in one or more segments using ":PHDR", then the linker will place all subsequent allocatable sections, which do not specify ":PHDR", into the same segments. In order to have the NOTES section in both PT_LOAD (":text") and PT_NOTE (":note"), both segments are marked, and the only way to to undo this to keep subsequent sections out of PT_NOTE is to mark the following section with just the single desired PT_LOAD (":text"). In preparation for having a common NOTES macro, perform the segment assignment use a dummy section (as done by other architectures). Signed-off-by: Kees Cook --- arch/x86/kernel/vmlinux.lds.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index e2feacf921a0..788e78978030 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -147,8 +147,9 @@ SECTIONS } :text = 0x9090 NOTES :text :note + .dummy : { *(.dummy) } :text - EXCEPTION_TABLE(16) :text = 0x9090 + EXCEPTION_TABLE(16) /* .text should occupy whole number of pages */ . = ALIGN(PAGE_SIZE); From patchwork Fri Oct 11 00:05:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184649 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 EC217139A for ; Fri, 11 Oct 2019 00:08:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 97DCF214E0 for ; Fri, 11 Oct 2019 00:08:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="M/gZUFKX"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="carhZDVu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97DCF214E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ZxKchBfjtmKSYM0bBFldZpVhebFXFb0Hl2pZsPCGqbs=; b=M/gZUFKXdXGUwfc97IqIwG9U2w ow3TMleBRTYjA0Sl3gDjG5A6FEQyaTP6MNiiF9RmF4n9Uvid2M2ozjzuYzuySZsEMigB3yCOY8oDX j3Xd5SFWQRyhMONb7bTCz09Ybpv0G1MEO8scVsdD/v1PKraS1FdAKtOb0H/lqo4o+I0owqDthlDM6 FlpBDW9f1Q5ceAhdYU0+D2AyCUZepeD7tNCREWGoMtZmWDjtGXdpGzRI6MaG323V9+VBzQExkSsM8 +En0Iiy0iv1lt9GqBF+cL0WiQx9vy7/s6w26e7NmMzPr+/HBCZG8bG8/vAf8veplCMi4C7ovhFHZY KSNssLqw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiU1-0005WV-Ht; Fri, 11 Oct 2019 00:08:37 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiRw-0003bG-FZ for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:06:30 +0000 Received: by mail-pf1-x442.google.com with SMTP id y22so4947144pfr.3 for ; Thu, 10 Oct 2019 17:06:28 -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=n5VmKDs7q8vdBz4+9T2sJG9hHU7BSOvzC0pvhvZX8so=; b=carhZDVuV7aWHe/mVOzWup+o5oNODCRSaKYDJLBEexacyYhrHfUMNbKXFo59HsfLdT wZ6hMFSRQexCI22v5IG5NUFM2WcEObK5BgW99c0DZtHkj30esilAfjApmPDIP3pjvWiL pfzZb27IerlCy8SvvnyBoQgndOKKC0Ory7bvc= 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=n5VmKDs7q8vdBz4+9T2sJG9hHU7BSOvzC0pvhvZX8so=; b=GARgw2Zba3Bcym2blxFtYBOA5BnWhU1al0ZMn14m/c21uSc9JQeMCdsXmC+LjzdsTf woyM8iy7VL6rchn/Jh3+DZDl7tUgrBgd+BESKUdbDwduZK8HojkaeHytqeUS9llLnIK6 xG+sxSGo/1c0zXwdeD8633J4FgA54AcAd1qwgfiT7Yh5lQTMMpLRn0j6rdp/xWkJ8k+9 6xqIiRIEtkjvjVYjk8cNkblAOUFIGSnK0IJfe+cDqfk7o1nzDfTBdR1pBVWSCHCnNmPr 2VoFL5jboO9Z7bQI/tzdTxtcsjaGLjAOCFIw3EF22A3HrpGBumcpQOVMAy+Rl9sBLezA U/XA== X-Gm-Message-State: APjAAAV3Mpzo6s3ks7y5aYge1Cvk5ZhhKOxwHYdq+xwsx5kRaGEzpMD1 q8z9n2fld1o0m1heEngrcCp7eQ== X-Google-Smtp-Source: APXvYqx8Gwnw4oVnhwjvlupfQ+jLMpTkOFUHSLw0DgIUj0K31Z94tjG2CFAjw0mYBaG87MVpGGwzjQ== X-Received: by 2002:a62:1b45:: with SMTP id b66mr13449656pfb.34.1570752387906; Thu, 10 Oct 2019 17:06:27 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id d19sm6444280pjz.5.2019.10.10.17.06.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:06:24 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 08/29] vmlinux.lds.h: Provide EMIT_PT_NOTE to indicate export of .notes Date: Thu, 10 Oct 2019 17:05:48 -0700 Message-Id: <20191011000609.29728-9-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_170628_574100_EBBDB41A X-CRM114-Status: GOOD ( 14.20 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In preparation for moving NOTES into RO_DATA, provide a mechanism for architectures that want to emit a PT_NOTE Program Header to do so. Signed-off-by: Kees Cook --- arch/alpha/kernel/vmlinux.lds.S | 3 +++ arch/ia64/kernel/vmlinux.lds.S | 2 ++ arch/mips/kernel/vmlinux.lds.S | 12 ++++++------ arch/powerpc/kernel/vmlinux.lds.S | 1 + arch/s390/kernel/vmlinux.lds.S | 2 ++ arch/x86/kernel/vmlinux.lds.S | 2 ++ include/asm-generic/vmlinux.lds.h | 8 ++++++++ 7 files changed, 24 insertions(+), 6 deletions(-) diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S index 781090cacc96..363a60ba7c31 100644 --- a/arch/alpha/kernel/vmlinux.lds.S +++ b/arch/alpha/kernel/vmlinux.lds.S @@ -1,4 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ + +#define EMITS_PT_NOTE + #include #include #include diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S index 2c4f23c390ad..7cf4958b732d 100644 --- a/arch/ia64/kernel/vmlinux.lds.S +++ b/arch/ia64/kernel/vmlinux.lds.S @@ -5,6 +5,8 @@ #include #include +#define EMITS_PT_NOTE + #include OUTPUT_FORMAT("elf64-ia64-little") diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index 33ee0d18fb0a..1c95612eb800 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -10,6 +10,11 @@ */ #define BSS_FIRST_SECTIONS *(.bss..swapper_pg_dir) +/* Cavium Octeon should not have a separate PT_NOTE Program Header. */ +#ifndef CONFIG_CAVIUM_OCTEON_SOC +#define EMITS_PT_NOTE +#endif + #include #undef mips @@ -76,12 +81,7 @@ SECTIONS __stop___dbe_table = .; } -#ifdef CONFIG_CAVIUM_OCTEON_SOC -#define NOTES_HEADER -#else /* CONFIG_CAVIUM_OCTEON_SOC */ -#define NOTES_HEADER :note -#endif /* CONFIG_CAVIUM_OCTEON_SOC */ - NOTES :text NOTES_HEADER + NOTES NOTES_HEADERS .dummy : { *(.dummy) } :text _sdata = .; /* Start of data section */ diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index e184a63aa5b0..7e26e20c8324 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -6,6 +6,7 @@ #endif #define BSS_FIRST_SECTIONS *(.bss.prominit) +#define EMITS_PT_NOTE #include #include diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S index 13294fef473e..646d939346df 100644 --- a/arch/s390/kernel/vmlinux.lds.S +++ b/arch/s390/kernel/vmlinux.lds.S @@ -15,6 +15,8 @@ /* Handle ro_after_init data on our own. */ #define RO_AFTER_INIT_DATA +#define EMITS_PT_NOTE + #include #include diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 788e78978030..2e18bf5c1aed 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -21,6 +21,8 @@ #define LOAD_OFFSET __START_KERNEL_map #endif +#define EMITS_PT_NOTE + #include #include #include diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index dae64600ccbf..f5dd45ce73f1 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -54,6 +54,14 @@ #define LOAD_OFFSET 0 #endif +/* + * Only some architectures want to have the .notes segment visible in + * a separate PT_NOTE ELF Program Header. + */ +#ifdef EMITS_PT_NOTE +#define NOTES_HEADERS :text :note +#endif + /* Align . to a 8 byte boundary equals to maximum function alignment. */ #define ALIGN_FUNCTION() . = ALIGN(8) From patchwork Fri Oct 11 00:05:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184653 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 954EE1575 for ; Fri, 11 Oct 2019 00:09:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 72E41214E0 for ; Fri, 11 Oct 2019 00:09:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gxaL1bfL"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="bRMOq0IW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 72E41214E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=gIunnSwABGDZvjMS9hxX0urOhXjAHbUE8DrGNkLLTuA=; b=gxaL1bfLHNATUeUdVMTn1ml4AU P2Wf1v2eqOz2BS/MBGel8+RwlXXEqdx81gHbAyZH8279HIP0+4IxDIjfbrb2NCdtqpqU4dFsVhqx0 g+8ipC8LNF9I+QyzQhPBwL4HaK4cw+UQvMQmD1hn/cxiLRp/wdfos/JjmFv+IATtStlSf1WaBiWuT I1bDfwYikFS5zuVIG4mcSbH/aZmAg3keIom288A3GEh20SNd+bzE5WpzuLqU3bbz7qC6g7/lvYs0H GJLZTYqtlsGlJFStcCM7HSlCvMMG4CoglKbWy8jNa9hA7ei31acKjoj7EHurrCoBIdoVxt1mtQiPm BGkBnP3w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiUc-00069H-4n; Fri, 11 Oct 2019 00:09:14 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiRz-0003e8-IM for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:06:33 +0000 Received: by mail-pl1-x642.google.com with SMTP id c3so3596204plo.2 for ; Thu, 10 Oct 2019 17:06:31 -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=+3bCi815qDNxWXNrKwLag9umK9x4HOIYX8e5T++c31U=; b=bRMOq0IWtWeHkkuzrRxpAOjG+rR4hWqjBGGYrfiCb+g0Wo93lleOSNL5PlbwrMlX2m UcAArEZAR28PhZpJ9ZQ2+Jx+5/XMFJo+6I1v47AsbgjpXxkd6kYBN+6tNzEwHNlN3EwO GygHfZgrHj6MFQQb22vJtjl9/O27IaD4iLe3I= 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=+3bCi815qDNxWXNrKwLag9umK9x4HOIYX8e5T++c31U=; b=nFXBRzokuC5tmPoTCvFgGdfJu+CqJpYDCSZDOTW2ovN5CtaOitwMW0EnNGWZTRe1vZ kESEaNrQht+1X6owD59Jk7fGLCIYca4RDeGfHyeZzFe/eMryH1gvswwDdqvmC4Gx8wO0 ls1/s8F4iG3QX0aZgh8Vw9eY/ITEW9pjOgnd6qNM+v/n8ljMCufaD1yL1eTgg6mwN0v1 3urZf4wB1W6Z8qqw4tho4SH7TZhv25Lrb9MT0L22Pri4MKIgRqQ1/Fu0+PLTl97SL4Py hI5WygoVlTFz3nDilsrUou+cg1CGmckuvazEd6ivIPGvjZvCxlgocHW9urCP3atf9Cui p54g== X-Gm-Message-State: APjAAAXDw8hwXSbGLgp7vWuJ+7oCPvRg+NW8jJcu4fG7+SZdgrHgRNf1 VyomsW3InktgI9wJaBGKYB9Atw== X-Google-Smtp-Source: APXvYqy0SXetX4NVbIikmpWxxdgAixqZ0JQVCss4X5LB0rtMMzElGLP4iAy5+ASzEE3vf1MUkTjFzA== X-Received: by 2002:a17:902:8218:: with SMTP id x24mr11712571pln.139.1570752390532; Thu, 10 Oct 2019 17:06:30 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id i8sm7454975pgl.18.2019.10.10.17.06.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:06:24 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 09/29] vmlinux.lds.h: Move Program Header restoration into NOTES macro Date: Thu, 10 Oct 2019 17:05:49 -0700 Message-Id: <20191011000609.29728-10-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_170631_629091_6B2ABC2A X-CRM114-Status: GOOD ( 15.28 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:642 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In preparation for moving NOTES into RO_DATA, make the Program Header assignment restoration be part of the NOTES macro itself. Signed-off-by: Kees Cook --- arch/alpha/kernel/vmlinux.lds.S | 5 +---- arch/ia64/kernel/vmlinux.lds.S | 4 +--- arch/mips/kernel/vmlinux.lds.S | 3 +-- arch/powerpc/kernel/vmlinux.lds.S | 4 +--- arch/s390/kernel/vmlinux.lds.S | 4 +--- arch/x86/kernel/vmlinux.lds.S | 3 +-- include/asm-generic/vmlinux.lds.h | 13 +++++++++++-- 7 files changed, 17 insertions(+), 19 deletions(-) diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S index 363a60ba7c31..cdfdc91ce64c 100644 --- a/arch/alpha/kernel/vmlinux.lds.S +++ b/arch/alpha/kernel/vmlinux.lds.S @@ -34,10 +34,7 @@ SECTIONS swapper_pg_dir = SWAPPER_PGD; _etext = .; /* End of text section */ - NOTES :text :note - .dummy : { - *(.dummy) - } :text + NOTES RODATA EXCEPTION_TABLE(16) diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S index 7cf4958b732d..bfc937ec168c 100644 --- a/arch/ia64/kernel/vmlinux.lds.S +++ b/arch/ia64/kernel/vmlinux.lds.S @@ -70,9 +70,7 @@ SECTIONS { /* * Read-only data */ - NOTES :text :note /* put .notes in text and mark in PT_NOTE */ - code_continues : { - } :text /* switch back to regular program... */ + NOTES EXCEPTION_TABLE(16) diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index 1c95612eb800..6a22f531d815 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -81,8 +81,7 @@ SECTIONS __stop___dbe_table = .; } - NOTES NOTES_HEADERS - .dummy : { *(.dummy) } :text + NOTES _sdata = .; /* Start of data section */ RODATA diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index 7e26e20c8324..4f19d814d592 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -164,9 +164,7 @@ SECTIONS #endif EXCEPTION_TABLE(0) - NOTES :text :note - /* Restore program header away from PT_NOTE. */ - .dummy : { *(.dummy) } :text + NOTES /* * Init sections discarded at runtime diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S index 646d939346df..f88eedeb915a 100644 --- a/arch/s390/kernel/vmlinux.lds.S +++ b/arch/s390/kernel/vmlinux.lds.S @@ -52,9 +52,7 @@ SECTIONS _etext = .; /* End of text section */ } :text = 0x0700 - NOTES :text :note - - .dummy : { *(.dummy) } :text + NOTES RO_DATA_SECTION(PAGE_SIZE) diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 2e18bf5c1aed..8be25b09c2b7 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -148,8 +148,7 @@ SECTIONS _etext = .; } :text = 0x9090 - NOTES :text :note - .dummy : { *(.dummy) } :text + NOTES EXCEPTION_TABLE(16) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index f5dd45ce73f1..97d4299f14dc 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -56,10 +56,18 @@ /* * Only some architectures want to have the .notes segment visible in - * a separate PT_NOTE ELF Program Header. + * a separate PT_NOTE ELF Program Header. When this happens, it needs + * to be visible in both the kernel text's PT_LOAD and the PT_NOTE + * Program Headers. In this case, though, the PT_LOAD needs to be made + * the default again so that all the following sections don't also end + * up in the PT_NOTE Program Header. */ #ifdef EMITS_PT_NOTE #define NOTES_HEADERS :text :note +#define NOTES_HEADERS_RESTORE __restore_ph : { *(.__restore_ph) } :text +#else +#define NOTES_HEADERS +#define NOTES_HEADERS_RESTORE #endif /* Align . to a 8 byte boundary equals to maximum function alignment. */ @@ -798,7 +806,8 @@ __start_notes = .; \ KEEP(*(.note.*)) \ __stop_notes = .; \ - } + } NOTES_HEADERS \ + NOTES_HEADERS_RESTORE #define INIT_SETUP(initsetup_align) \ . = ALIGN(initsetup_align); \ From patchwork Fri Oct 11 00:05:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184655 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 008821575 for ; Fri, 11 Oct 2019 00:09:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D07F1214E0 for ; Fri, 11 Oct 2019 00:09:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="E2N+ujiJ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="OQKBcExF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D07F1214E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=YNykPNkItajxCr0ZVcEyFozLw708e4BGgo34KfqcnRw=; b=E2N+ujiJL16BmSQB6pomOfvanM YV9v3jLI6l3dS3UVK9HhPsc8E2m/jveyOPv5ZVyv88ji9oeeHWtLai51AESTLpQjnL97mPAJeq7vG NhAKCTdrYNz9bh2eouP3i/Yo4AcjyitQ7XZiccIFQqDwGcsASRoc3IpSwNJN8sFAOwAGaSAHwgQgd SLx8THVkZt3Et82eu17U22vxnKcsILAERQy15n5sjmO7quPdqrAh4opPe5oaj6EPtPsWSNJArJTnL YoAbvSV4muW59+6qlb+Mo5FtthfSnrRKKfGhVLqsAGV9dQXOzaqXsjYjCBv+Fb0+C8aZzQyAfv36E pbwM+IPg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiUs-0006QT-EC; Fri, 11 Oct 2019 00:09:30 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiS0-0003fa-Jh for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:06:35 +0000 Received: by mail-pg1-x541.google.com with SMTP id p30so4699857pgl.2 for ; Thu, 10 Oct 2019 17:06:32 -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=VrsGi2VZmYoiW+g+QiVO7qh6HvEnyeD+CrJg+uPrkoA=; b=OQKBcExFOiX1HKaPOMjgP0f5M5Rk/R3xX98+Rcyo+3jmCHbA63kWOr2kJUTAaMwpUW J/2hwHvuaDxCAR497+IkpLYGVosGlHsEcV7hJlxMlTqoxdXJ019MBw+vK/M2wqJo9QKt jf52JQ1V7l2DJk51LUQDcUn4rDRJeInHfnnKQ= 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=VrsGi2VZmYoiW+g+QiVO7qh6HvEnyeD+CrJg+uPrkoA=; b=qNzpJGBWNo73gV/jrHtCWHlOYyzO1T8mUNgTgPJQdfikri72lI4zT3+lfS2VVtVPXK 4EpDf0iy5LFoe26K9eWX03BRack75p03WiVpfxN/AOkhA8r9Xq0ZLAD8+YY16wH/OX5i wfQrdzsPdnJnYecSL4yMHF8GYT/yWYEeOcgz9FA3uDwrJJqermWVnphlpyuJAUD+ixle TYSI6IbxS/stYnh53rdoxRxn3dtlPR5ToG6fu/Hbzs1mvyAorLDaoI8R7JuItpDa+zy8 HWn0KUQK1d3Vf/u9Qbia0NEdc1A4+2SsNdevi8Yerth5RnGHi7T50h1SN8UdIc604ok6 eLRg== X-Gm-Message-State: APjAAAWAgS76wtHexCGsq4osYaiFvvXZ5bo1SvquLs5os+8o1lM9XeWm Ps9wKSllSFJOJdHc4lO/xf/OYA== X-Google-Smtp-Source: APXvYqyG0aLDQjCng0TEFgnQccQ0DvhmHJCw7HgSlyuRckLN4/WMPTG7VcFYDq0E8KeXg/Briln7FA== X-Received: by 2002:a17:90a:3acb:: with SMTP id b69mr14517610pjc.75.1570752391821; Thu, 10 Oct 2019 17:06:31 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id e192sm9403017pfh.83.2019.10.10.17.06.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:06:24 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 10/29] vmlinux.lds.h: Move NOTES into RO_DATA Date: Thu, 10 Oct 2019 17:05:50 -0700 Message-Id: <20191011000609.29728-11-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_170632_782361_D06541A8 X-CRM114-Status: GOOD ( 13.80 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:541 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The .notes section should be non-executable read-only data. As such, move it to the RO_DATA macro instead of being per-architecture defined. Signed-off-by: Kees Cook --- arch/alpha/kernel/vmlinux.lds.S | 2 -- arch/arc/kernel/vmlinux.lds.S | 2 -- arch/arm/kernel/vmlinux-xip.lds.S | 2 -- arch/arm/kernel/vmlinux.lds.S | 2 -- arch/arm64/kernel/vmlinux.lds.S | 1 - arch/c6x/kernel/vmlinux.lds.S | 1 - arch/csky/kernel/vmlinux.lds.S | 1 - arch/h8300/kernel/vmlinux.lds.S | 1 - arch/hexagon/kernel/vmlinux.lds.S | 1 - arch/ia64/kernel/vmlinux.lds.S | 2 -- arch/microblaze/kernel/vmlinux.lds.S | 1 - arch/mips/kernel/vmlinux.lds.S | 2 -- arch/nds32/kernel/vmlinux.lds.S | 1 - arch/nios2/kernel/vmlinux.lds.S | 1 - arch/openrisc/kernel/vmlinux.lds.S | 1 - arch/parisc/kernel/vmlinux.lds.S | 1 - arch/powerpc/kernel/vmlinux.lds.S | 2 -- arch/riscv/kernel/vmlinux.lds.S | 1 - arch/s390/kernel/vmlinux.lds.S | 2 -- arch/sh/kernel/vmlinux.lds.S | 1 - arch/sparc/kernel/vmlinux.lds.S | 1 - arch/um/include/asm/common.lds.S | 1 - arch/unicore32/kernel/vmlinux.lds.S | 1 - arch/x86/kernel/vmlinux.lds.S | 2 -- arch/xtensa/kernel/vmlinux.lds.S | 1 - include/asm-generic/vmlinux.lds.h | 9 +++++---- 26 files changed, 5 insertions(+), 38 deletions(-) diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S index cdfdc91ce64c..bf28043485f6 100644 --- a/arch/alpha/kernel/vmlinux.lds.S +++ b/arch/alpha/kernel/vmlinux.lds.S @@ -34,8 +34,6 @@ SECTIONS swapper_pg_dir = SWAPPER_PGD; _etext = .; /* End of text section */ - NOTES - RODATA EXCEPTION_TABLE(16) diff --git a/arch/arc/kernel/vmlinux.lds.S b/arch/arc/kernel/vmlinux.lds.S index 6c693a9d29b6..1d6eef4b6976 100644 --- a/arch/arc/kernel/vmlinux.lds.S +++ b/arch/arc/kernel/vmlinux.lds.S @@ -118,8 +118,6 @@ SECTIONS /DISCARD/ : { *(.eh_frame) } #endif - NOTES - . = ALIGN(PAGE_SIZE); _end = . ; diff --git a/arch/arm/kernel/vmlinux-xip.lds.S b/arch/arm/kernel/vmlinux-xip.lds.S index 8c74037ade22..d2a9651c24ad 100644 --- a/arch/arm/kernel/vmlinux-xip.lds.S +++ b/arch/arm/kernel/vmlinux-xip.lds.S @@ -70,8 +70,6 @@ SECTIONS ARM_UNWIND_SECTIONS #endif - NOTES - _etext = .; /* End of text and rodata section */ ARM_VECTORS diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index 23150c0f0f4d..068db6860867 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -81,8 +81,6 @@ SECTIONS ARM_UNWIND_SECTIONS #endif - NOTES - #ifdef CONFIG_STRICT_KERNEL_RWX . = ALIGN(1< X-Patchwork-Id: 11184651 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 101C4139A for ; Fri, 11 Oct 2019 00:08:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C2B8C214E0 for ; Fri, 11 Oct 2019 00:08:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CDpLWQ8Z"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="cHZ91CVx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2B8C214E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Qkhvr2E3ORt3azu8xmZwuTZLEX5FpVxggUxDuN0QWwE=; b=CDpLWQ8ZZob9/cyYAYuLQIfjGr eKNUNFF/pipBEqqwuYzSEEhYf1ER0WzUI2zCIhN9gt8bFfGyjiIhl7IrjDqPQ1fZUyuBrfEU4BkCV RqqLS1YfPSsymuVJvu3mPR3YDZkWLJhOD0iv1IT3rEOZo4XzrqjFHm4fLgGzyLRfimHosWSIQpVLE GuP/dkFI+2aB5ZWcTT9WuCsVXGT7ZRBwIug1uyGFKz5s41w3gH6gVlpGtp7Hc7G7S+GsjzcM9s+ec uuzc7dwrpfSs21Z5i2h4jr4TToOjuniwl/bQTZ7YGXi7NtP+0A3+RyEPaMi+qEhpD/K9jPxhrnwzb nydU2zCg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiUH-0005mU-QS; Fri, 11 Oct 2019 00:08:53 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiRx-0003c6-7r for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:06:30 +0000 Received: by mail-pf1-x443.google.com with SMTP id y72so4923816pfb.12 for ; Thu, 10 Oct 2019 17:06:29 -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=NdxCafKKRqXAoKJS3a+7E7MX2efPsfhraTr7Vwa5zkA=; b=cHZ91CVxuyng0UUZxGcb/ber128JimxZzD4s8SDtIkcbdkfkK9QM8pnThLhmF0agpR T7rmBmBvoM7a8G3Gx26RdR3XR/1f8VRXaujTb/vPtdDG1XhtEUbWfIJWjMRQdw9gHq3B iOZPAybj973b7Yiu/eaaA1VBQXDHW1/4thP5g= 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=NdxCafKKRqXAoKJS3a+7E7MX2efPsfhraTr7Vwa5zkA=; b=iW7zFf4BMDW61DAob9RezuFAURGr4geiM3RTTrzXrWz5IIB0lKQpd6Pu+L4iN0KJOO kGMx64AHFG8rjo1T5L1dW5dZIXuA0RpHg/C4TEbKlH8mrVSa0eo/R5arkRx2JFnzLuW4 44o9rV9pb/f1xQ5pZgJV5ezV8jDfCeu4g+8k6UiwBxxMk7fwwj/0jqabiqRmGc9rhU/U lRvrETt45ouvyYdAsv3itVhUmOxaUU1nF252mX24pXzxKfDyTGv/Nd/RRdEuKKRtcg9E bJUtw9B03Lr5QXaCeGd45/8xQBVgPyrWepEAFs+WbowhdJY4Y99nrKjTTSqyzG3usuFo KK0A== X-Gm-Message-State: APjAAAVo9Jk5galfaSTia9OxnuelUnqJj04F3Mgi+OC4xyMrj2q524uw hxWKz9eknOTfkuF5bHft1CeInA== X-Google-Smtp-Source: APXvYqz3ed6UFMtmTs9WyLDFjU7LZoWgRldfZKGM1qhYTNl+e8Jhzebc8fAsIpgzugR9ERVwOeUjmA== X-Received: by 2002:a62:1bd3:: with SMTP id b202mr13350926pfb.50.1570752388551; Thu, 10 Oct 2019 17:06:28 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id 64sm9017564pfx.31.2019.10.10.17.06.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:06:24 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 11/29] vmlinux.lds.h: Replace RODATA with RO_DATA Date: Thu, 10 Oct 2019 17:05:51 -0700 Message-Id: <20191011000609.29728-12-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_170629_336719_C54C3B2A X-CRM114-Status: GOOD ( 12.40 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:443 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org There's no reason to keep the RODATA macro: replace the callers with the expected RO_DATA macro. Signed-off-by: Kees Cook Reported-by: noreply@ellerman.id.au --- arch/alpha/kernel/vmlinux.lds.S | 2 +- arch/ia64/kernel/vmlinux.lds.S | 2 +- arch/microblaze/kernel/vmlinux.lds.S | 2 +- arch/mips/kernel/vmlinux.lds.S | 2 +- arch/um/include/asm/common.lds.S | 2 +- arch/xtensa/kernel/vmlinux.lds.S | 2 +- include/asm-generic/vmlinux.lds.h | 4 +--- 7 files changed, 7 insertions(+), 9 deletions(-) diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S index bf28043485f6..af411817dd7d 100644 --- a/arch/alpha/kernel/vmlinux.lds.S +++ b/arch/alpha/kernel/vmlinux.lds.S @@ -34,7 +34,7 @@ SECTIONS swapper_pg_dir = SWAPPER_PGD; _etext = .; /* End of text section */ - RODATA + RO_DATA(4096) EXCEPTION_TABLE(16) /* Will be freed after init */ diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S index fae077595756..11d5115bc44d 100644 --- a/arch/ia64/kernel/vmlinux.lds.S +++ b/arch/ia64/kernel/vmlinux.lds.S @@ -104,7 +104,7 @@ SECTIONS { code_continues2 : { } :text - RODATA + RO_DATA(4096) .opd : AT(ADDR(.opd) - LOAD_OFFSET) { __start_opd = .; diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S index d008e50bb212..2299694748ea 100644 --- a/arch/microblaze/kernel/vmlinux.lds.S +++ b/arch/microblaze/kernel/vmlinux.lds.S @@ -51,7 +51,7 @@ SECTIONS { } . = ALIGN(16); - RODATA + RO_DATA(4096) EXCEPTION_TABLE(16) /* diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index 91e566defc16..a5f00ec73ea6 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -82,7 +82,7 @@ SECTIONS } _sdata = .; /* Start of data section */ - RODATA + RO_DATA(4096) /* writeable */ .data : { /* Data */ diff --git a/arch/um/include/asm/common.lds.S b/arch/um/include/asm/common.lds.S index 91aca356095f..7145ce699982 100644 --- a/arch/um/include/asm/common.lds.S +++ b/arch/um/include/asm/common.lds.S @@ -9,7 +9,7 @@ _sdata = .; PROVIDE (sdata = .); - RODATA + RO_DATA(4096) .unprotected : { *(.unprotected) } . = ALIGN(4096); diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S index a0a843745695..b97e5798b9cf 100644 --- a/arch/xtensa/kernel/vmlinux.lds.S +++ b/arch/xtensa/kernel/vmlinux.lds.S @@ -124,7 +124,7 @@ SECTIONS . = ALIGN(16); - RODATA + RO_DATA(4096) /* Relocation table */ diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index dc3390ec6b60..a0a989fbe411 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -518,9 +518,7 @@ . = ALIGN((align)); \ __end_rodata = .; -/* RODATA & RO_DATA provided for backward compatibility. - * All archs are supposed to use RO_DATA() */ -#define RODATA RO_DATA_SECTION(4096) +/* All archs are supposed to use RO_DATA() */ #define RO_DATA(align) RO_DATA_SECTION(align) /* From patchwork Fri Oct 11 00:05:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184659 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 ADDE9139A for ; Fri, 11 Oct 2019 00:10:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6D20121920 for ; Fri, 11 Oct 2019 00:10:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KgLZN4MK"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Vr/ouYU4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D20121920 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=jX7Z98iH6l+DsDqz2bWKRc+DR7rA2lZIUJBJSoYFoiA=; b=KgLZN4MKxJruOC3Q/l53kaFPpL xdYg6rBGryd6D3sYBkJnh42zNgi03ESDmDmajn410RhtO4JeGRCFqwStSWbxe2G/N89YHHWZyLfCn y6lF85m1oldQKkJxhWfzh3Nkw1W/fCAlBpX0QToJ6FRLifVIXVWdmfurPwYfcJyxvPuRdeyuyaDTc lMHjlew646mc9rNJ9u9mb0cAX6a05jZRzc4CBiN8vugGkTxDLA2wlohtlV24uHY4G4IMAYFi/cGWS aUGUaNgRIUilXpqKbJka5HvEAnBxve9yq53JEr3NPsGpJWVGvka7xenMHNTIxjbJxBf3l3sFu0Z52 NutxIbnQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiVM-0006vt-Fr; Fri, 11 Oct 2019 00:10:00 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiS1-0003fl-ET for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:06:35 +0000 Received: by mail-pf1-x443.google.com with SMTP id q7so4935182pfh.8 for ; Thu, 10 Oct 2019 17:06:32 -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=DuZAsZxZLPZkISe3dR0RWEfgmN2J22w1LR1gS9Q060Y=; b=Vr/ouYU4DY+c+dPQgQCkZkPiefEjf85+Y3JixQCNriQRX8TUgPrqjfwH2oAScfYlP0 v87cpbqpOqc05HYBtGLLLUi6frPtF1HntlUxhqWMdWSbbc0OGbFX6+Vj/cbPADRpI4my m83qvTkkG7ExaRX6A003rjgQHcCwPYDISXCGA= 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=DuZAsZxZLPZkISe3dR0RWEfgmN2J22w1LR1gS9Q060Y=; b=N3ir1FU5X7dfDpXguVi8GZZbw5dkwGu+to2az3pqLGqLedpAA1uS8M1G8VpVaZlZ87 g46XaZn/YnS/EGYvFzAFMT03etX1450QaWP9rXdeHbmQbfpKbhWrC/MKP8TzPH+CaZyE UsWxaCb8YH6xsB8b1MgwcNWYxor5uWh4NSFm5omzh8iVipzSNgCHaUKMm/W4tscgeGmy kWypjISlJw1AIY6nBMD/hZQukUg/1QGdTxnYvWauopIbW/e90HvrleYqvZLQzjjq6RHa m/9OjXp7CZ1+SldGrJrGlU4RjHCDFIf4xER/vy9Cbx0IB8546w+0ooqnMAYZqDhJ63X6 DILA== X-Gm-Message-State: APjAAAXPmnz5iMkQlcsgoY2yUu5RWzHq2YJtSIYYRkAU7Id0y0KLTFPA qsuxAu0HePbGN19DAlnjpuuBQQ== X-Google-Smtp-Source: APXvYqy4FSC3v/ZdArK/c4Ac15cpP2VC7Cyr72iHZzxLlMtXtVU20YHYU76YTX+x0YEjwevhm39Xxw== X-Received: by 2002:a62:b616:: with SMTP id j22mr13290419pff.35.1570752391278; Thu, 10 Oct 2019 17:06:31 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id w2sm7929867pfn.57.2019.10.10.17.06.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:06:24 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 12/29] vmlinux.lds.h: Replace RO_DATA_SECTION with RO_DATA Date: Thu, 10 Oct 2019 17:05:52 -0700 Message-Id: <20191011000609.29728-13-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_170633_612848_E37709DE X-CRM114-Status: GOOD ( 13.19 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:443 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Finish renaming RO_DATA_SECTION to RO_DATA. (Calling this a "section" is a lie, since it's multiple sections and section flags cannot be applied to the macro.) Signed-off-by: Kees Cook Acked-by: Geert Uytterhoeven --- arch/arc/kernel/vmlinux.lds.S | 2 +- arch/c6x/kernel/vmlinux.lds.S | 2 +- arch/csky/kernel/vmlinux.lds.S | 2 +- arch/h8300/kernel/vmlinux.lds.S | 2 +- arch/hexagon/kernel/vmlinux.lds.S | 2 +- arch/m68k/kernel/vmlinux-nommu.lds | 2 +- arch/nds32/kernel/vmlinux.lds.S | 2 +- arch/nios2/kernel/vmlinux.lds.S | 2 +- arch/openrisc/kernel/vmlinux.lds.S | 4 ++-- arch/parisc/kernel/vmlinux.lds.S | 4 ++-- arch/riscv/kernel/vmlinux.lds.S | 2 +- arch/s390/kernel/vmlinux.lds.S | 2 +- arch/unicore32/kernel/vmlinux.lds.S | 2 +- include/asm-generic/vmlinux.lds.h | 7 ++----- 14 files changed, 17 insertions(+), 20 deletions(-) diff --git a/arch/arc/kernel/vmlinux.lds.S b/arch/arc/kernel/vmlinux.lds.S index 1d6eef4b6976..7d1d27066deb 100644 --- a/arch/arc/kernel/vmlinux.lds.S +++ b/arch/arc/kernel/vmlinux.lds.S @@ -95,7 +95,7 @@ SECTIONS _etext = .; _sdata = .; - RO_DATA_SECTION(PAGE_SIZE) + RO_DATA(PAGE_SIZE) /* * 1. this is .data essentially diff --git a/arch/c6x/kernel/vmlinux.lds.S b/arch/c6x/kernel/vmlinux.lds.S index d6e3802536b3..a3547f9d415b 100644 --- a/arch/c6x/kernel/vmlinux.lds.S +++ b/arch/c6x/kernel/vmlinux.lds.S @@ -82,7 +82,7 @@ SECTIONS EXCEPTION_TABLE(16) - RO_DATA_SECTION(PAGE_SIZE) + RO_DATA(PAGE_SIZE) .const : { *(.const .const.* .gnu.linkonce.r.*) diff --git a/arch/csky/kernel/vmlinux.lds.S b/arch/csky/kernel/vmlinux.lds.S index 75dd31412242..8598bd7a7bcd 100644 --- a/arch/csky/kernel/vmlinux.lds.S +++ b/arch/csky/kernel/vmlinux.lds.S @@ -49,7 +49,7 @@ SECTIONS _sdata = .; - RO_DATA_SECTION(PAGE_SIZE) + RO_DATA(PAGE_SIZE) RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) _edata = .; diff --git a/arch/h8300/kernel/vmlinux.lds.S b/arch/h8300/kernel/vmlinux.lds.S index 88776e785245..d3247d33b115 100644 --- a/arch/h8300/kernel/vmlinux.lds.S +++ b/arch/h8300/kernel/vmlinux.lds.S @@ -38,7 +38,7 @@ SECTIONS _etext = . ; } EXCEPTION_TABLE(16) - RO_DATA_SECTION(4) + RO_DATA(4) ROMEND = .; #if defined(CONFIG_ROMKERNEL) . = RAMTOP; diff --git a/arch/hexagon/kernel/vmlinux.lds.S b/arch/hexagon/kernel/vmlinux.lds.S index 6a6e8fc422ee..0145251fa317 100644 --- a/arch/hexagon/kernel/vmlinux.lds.S +++ b/arch/hexagon/kernel/vmlinux.lds.S @@ -50,7 +50,7 @@ SECTIONS _sdata = .; RW_DATA_SECTION(32,PAGE_SIZE,_THREAD_SIZE) - RO_DATA_SECTION(PAGE_SIZE) + RO_DATA(PAGE_SIZE) _edata = .; EXCEPTION_TABLE(16) diff --git a/arch/m68k/kernel/vmlinux-nommu.lds b/arch/m68k/kernel/vmlinux-nommu.lds index cf6edda38971..de80f8b8ae78 100644 --- a/arch/m68k/kernel/vmlinux-nommu.lds +++ b/arch/m68k/kernel/vmlinux-nommu.lds @@ -60,7 +60,7 @@ SECTIONS { #endif _sdata = .; - RO_DATA_SECTION(PAGE_SIZE) + RO_DATA(PAGE_SIZE) RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE) _edata = .; diff --git a/arch/nds32/kernel/vmlinux.lds.S b/arch/nds32/kernel/vmlinux.lds.S index c4f1c5a604c3..10ff570ba95b 100644 --- a/arch/nds32/kernel/vmlinux.lds.S +++ b/arch/nds32/kernel/vmlinux.lds.S @@ -53,7 +53,7 @@ SECTIONS _etext = .; /* End of text and rodata section */ _sdata = .; - RO_DATA_SECTION(PAGE_SIZE) + RO_DATA(PAGE_SIZE) RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) _edata = .; diff --git a/arch/nios2/kernel/vmlinux.lds.S b/arch/nios2/kernel/vmlinux.lds.S index 20e4078b3477..318804a2c7a1 100644 --- a/arch/nios2/kernel/vmlinux.lds.S +++ b/arch/nios2/kernel/vmlinux.lds.S @@ -49,7 +49,7 @@ SECTIONS __init_end = .; _sdata = .; - RO_DATA_SECTION(PAGE_SIZE) + RO_DATA(PAGE_SIZE) RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) _edata = .; diff --git a/arch/openrisc/kernel/vmlinux.lds.S b/arch/openrisc/kernel/vmlinux.lds.S index 142c51c994f5..f73e0d3ea09f 100644 --- a/arch/openrisc/kernel/vmlinux.lds.S +++ b/arch/openrisc/kernel/vmlinux.lds.S @@ -67,8 +67,8 @@ SECTIONS _sdata = .; - /* Page alignment required for RO_DATA_SECTION */ - RO_DATA_SECTION(PAGE_SIZE) + /* Page alignment required for RO_DATA */ + RO_DATA(PAGE_SIZE) _e_kernel_ro = .; /* Whatever comes after _e_kernel_ro had better be page-aligend, too */ diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S index 168d12b2ebb8..e1c563c7dca1 100644 --- a/arch/parisc/kernel/vmlinux.lds.S +++ b/arch/parisc/kernel/vmlinux.lds.S @@ -109,7 +109,7 @@ SECTIONS _sdata = .; /* Architecturally we need to keep __gp below 0x1000000 and thus - * in front of RO_DATA_SECTION() which stores lots of tracepoint + * in front of RO_DATA() which stores lots of tracepoint * and ftrace symbols. */ #ifdef CONFIG_64BIT . = ALIGN(16); @@ -127,7 +127,7 @@ SECTIONS } #endif - RO_DATA_SECTION(8) + RO_DATA(8) /* RO because of BUILDTIME_EXTABLE_SORT */ EXCEPTION_TABLE(8) diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S index df5229c4034d..66dc17d24dd9 100644 --- a/arch/riscv/kernel/vmlinux.lds.S +++ b/arch/riscv/kernel/vmlinux.lds.S @@ -52,7 +52,7 @@ SECTIONS /* Start of data section */ _sdata = .; - RO_DATA_SECTION(L1_CACHE_BYTES) + RO_DATA(L1_CACHE_BYTES) .srodata : { *(.srodata*) } diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S index beb4df053e20..b33c4823f8b5 100644 --- a/arch/s390/kernel/vmlinux.lds.S +++ b/arch/s390/kernel/vmlinux.lds.S @@ -52,7 +52,7 @@ SECTIONS _etext = .; /* End of text section */ } :text = 0x0700 - RO_DATA_SECTION(PAGE_SIZE) + RO_DATA(PAGE_SIZE) . = ALIGN(PAGE_SIZE); _sdata = .; /* Start of data section */ diff --git a/arch/unicore32/kernel/vmlinux.lds.S b/arch/unicore32/kernel/vmlinux.lds.S index 78c4c56057b0..367c80313bec 100644 --- a/arch/unicore32/kernel/vmlinux.lds.S +++ b/arch/unicore32/kernel/vmlinux.lds.S @@ -43,7 +43,7 @@ SECTIONS _etext = .; _sdata = .; - RO_DATA_SECTION(PAGE_SIZE) + RO_DATA(PAGE_SIZE) RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) _edata = .; diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index a0a989fbe411..061e57c609f6 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -23,7 +23,7 @@ * _etext = .; * * _sdata = .; - * RO_DATA_SECTION(PAGE_SIZE) + * RO_DATA(PAGE_SIZE) * RW_DATA_SECTION(...) * _edata = .; * @@ -363,7 +363,7 @@ /* * Read only Data */ -#define RO_DATA_SECTION(align) \ +#define RO_DATA(align) \ . = ALIGN((align)); \ .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ __start_rodata = .; \ @@ -518,9 +518,6 @@ . = ALIGN((align)); \ __end_rodata = .; -/* All archs are supposed to use RO_DATA() */ -#define RO_DATA(align) RO_DATA_SECTION(align) - /* * .text section. Map to function alignment to avoid address changes * during second ld run in second ld pass when generating System.map From patchwork Fri Oct 11 00:05:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184657 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 E97E8139A for ; Fri, 11 Oct 2019 00:09:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A98A0214E0 for ; Fri, 11 Oct 2019 00:09:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TQjga/nb"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="KM5dlcCC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A98A0214E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=aSPiyPfABXq6cGX+wkaehp2N/gI7h6G5QdFbT17yx0w=; b=TQjga/nbNfXj9yL2brI1aTyri5 2ynlUj8akzqxoWf4PW5x0P2Eb5gZbvQJuhePOEXURdF73zMR5mfFkgzbuLPj0Y2KhfFoEpIZ8u49V MeFl5yoncYnAR9w//+OwS2okzdTbVpbwR+rnN2t/MGrBAusdzBoqPiCA4jYe8i8KCJQooFCvc9i+e 1wqZudZMtSbHsCqZsC9sK380caymwkCp8tKawtdrGiCL4v45VzhA9FMzOchxoLW5ddMLDMiUaFe5m b39H8s8XM1dzfnKKK2DoLv8p+gQ4oMSOZCRFDom3Hta36AX3jocqzBcwskQQGyh5rIfviZN1MPgXw dYowStEw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiV8-0006h2-HM; Fri, 11 Oct 2019 00:09:46 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiS3-0003i0-EG for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:06:37 +0000 Received: by mail-pg1-x544.google.com with SMTP id e10so697216pgd.11 for ; Thu, 10 Oct 2019 17:06:35 -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=EJBkEWR6Ytr2XDSFYITiqnAtjMhSVp9dR2Ot4Fv1LAw=; b=KM5dlcCCTgyv17xjylw2TIbqN7K6dPZ8B/Ds1xgkN+VH1VnsMLZGDYHw66e+3BUCca riYqc1ojb5gszDWydSqCZ2Fjn9VwsKWKCEOYwWZAWYDNcZ2OqJksDr47PyLR2S5o5UoH YsXGqsdW8L4U3e3tTs2DjLs97Jn8rDnJ2PzHo= 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=EJBkEWR6Ytr2XDSFYITiqnAtjMhSVp9dR2Ot4Fv1LAw=; b=jaum7PahS4y6EdCkLoq7NSCHKg2wfz2VoA/5Dzs0h0rzo00ydD9XvkcfqcLVvsbi9j JFmVtmQr2FdHqWX6+RLuRylf/e7gstwDK4hihmbmLcLnnUlEkrv7cZ/Zcz5IHet0e0yE uddqoGqYBlnqwWAV9LvwMWQiW3hGWs91WipAamhHUr6BjZ/j+Ezvu9SbBjNvMKhwd5Qt ZEV+tNQAviNrJBfmOGBfTBO2OauIh41JXugwpwMPpwpQUIXH4HFldyD8yKowPgsDiBWi CRX0AoqfAMo4oc4DrPzSNmFO3XRT5sEK6m6BGDpYGUX6dURU4yQQooZ1JxIgSIR1gI0X 4VIw== X-Gm-Message-State: APjAAAUG+P3W589gXkfPPSEjdmKf/sGYm5V8k07/SDF04kA16bai4xbR BhGRBq09itlX9qUiTQq7QYVAUQ== X-Google-Smtp-Source: APXvYqx9mwKFFvFnZQH8YPkiWsa+huJ7n+p2MlQyZnW9rZY0KrtTniVpKFOfviihehBQNE3PYdY6uA== X-Received: by 2002:a17:90a:b902:: with SMTP id p2mr13429398pjr.62.1570752394448; 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 c8sm10527798pfi.117.2019.10.10.17.06.24 (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 Subject: [PATCH v2 13/29] vmlinux.lds.h: Replace RW_DATA_SECTION with RW_DATA Date: Thu, 10 Oct 2019 17:05:53 -0700 Message-Id: <20191011000609.29728-14-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_170635_488548_D2202B0F X-CRM114-Status: GOOD ( 13.54 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:544 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Rename RW_DATA_SECTION to RW_DATA. (Calling this a "section" is a lie, since it's multiple sections and section flags cannot be applied to the macro.) Signed-off-by: Kees Cook Acked-by: Geert Uytterhoeven --- arch/alpha/kernel/vmlinux.lds.S | 2 +- arch/arc/kernel/vmlinux.lds.S | 2 +- arch/arm/kernel/vmlinux-xip.lds.S | 2 +- arch/arm/kernel/vmlinux.lds.S | 2 +- arch/arm64/kernel/vmlinux.lds.S | 2 +- arch/csky/kernel/vmlinux.lds.S | 2 +- arch/h8300/kernel/vmlinux.lds.S | 2 +- arch/hexagon/kernel/vmlinux.lds.S | 2 +- arch/m68k/kernel/vmlinux-nommu.lds | 2 +- arch/m68k/kernel/vmlinux-std.lds | 2 +- arch/m68k/kernel/vmlinux-sun3.lds | 2 +- arch/microblaze/kernel/vmlinux.lds.S | 2 +- arch/nds32/kernel/vmlinux.lds.S | 2 +- arch/nios2/kernel/vmlinux.lds.S | 2 +- arch/openrisc/kernel/vmlinux.lds.S | 2 +- arch/parisc/kernel/vmlinux.lds.S | 2 +- arch/riscv/kernel/vmlinux.lds.S | 2 +- arch/s390/kernel/vmlinux.lds.S | 2 +- arch/sh/kernel/vmlinux.lds.S | 2 +- arch/sparc/kernel/vmlinux.lds.S | 2 +- arch/unicore32/kernel/vmlinux.lds.S | 2 +- arch/xtensa/kernel/vmlinux.lds.S | 2 +- include/asm-generic/vmlinux.lds.h | 4 ++-- 23 files changed, 24 insertions(+), 24 deletions(-) diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S index af411817dd7d..edc45f45523b 100644 --- a/arch/alpha/kernel/vmlinux.lds.S +++ b/arch/alpha/kernel/vmlinux.lds.S @@ -50,7 +50,7 @@ SECTIONS _sdata = .; /* Start of rw data section */ _data = .; - RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) + RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) .got : { *(.got) diff --git a/arch/arc/kernel/vmlinux.lds.S b/arch/arc/kernel/vmlinux.lds.S index 7d1d27066deb..54139a6f469b 100644 --- a/arch/arc/kernel/vmlinux.lds.S +++ b/arch/arc/kernel/vmlinux.lds.S @@ -101,7 +101,7 @@ SECTIONS * 1. this is .data essentially * 2. THREAD_SIZE for init.task, must be kernel-stk sz aligned */ - RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) + RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) _edata = .; diff --git a/arch/arm/kernel/vmlinux-xip.lds.S b/arch/arm/kernel/vmlinux-xip.lds.S index d2a9651c24ad..21b8b271c80d 100644 --- a/arch/arm/kernel/vmlinux-xip.lds.S +++ b/arch/arm/kernel/vmlinux-xip.lds.S @@ -112,7 +112,7 @@ SECTIONS . = ALIGN(THREAD_SIZE); _sdata = .; - RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) + RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) .data.ro_after_init : AT(ADDR(.data.ro_after_init) - LOAD_OFFSET) { *(.data..ro_after_init) } diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index 068db6860867..319ccb10846a 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -141,7 +141,7 @@ SECTIONS __init_end = .; _sdata = .; - RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) + RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) _edata = .; BSS_SECTION(0, 0, 0) diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index e7dafc29b1fa..a4b3e6c0680c 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -214,7 +214,7 @@ SECTIONS _data = .; _sdata = .; - RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_ALIGN) + RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_ALIGN) /* * Data written with the MMU off but read with the MMU on requires diff --git a/arch/csky/kernel/vmlinux.lds.S b/arch/csky/kernel/vmlinux.lds.S index 8598bd7a7bcd..2ff37beaf2bf 100644 --- a/arch/csky/kernel/vmlinux.lds.S +++ b/arch/csky/kernel/vmlinux.lds.S @@ -50,7 +50,7 @@ SECTIONS _sdata = .; RO_DATA(PAGE_SIZE) - RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) + RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) _edata = .; EXCEPTION_TABLE(L1_CACHE_BYTES) diff --git a/arch/h8300/kernel/vmlinux.lds.S b/arch/h8300/kernel/vmlinux.lds.S index d3247d33b115..2ac7bdcd2fe0 100644 --- a/arch/h8300/kernel/vmlinux.lds.S +++ b/arch/h8300/kernel/vmlinux.lds.S @@ -47,7 +47,7 @@ SECTIONS #endif _sdata = . ; __data_start = . ; - RW_DATA_SECTION(0, PAGE_SIZE, THREAD_SIZE) + RW_DATA(0, PAGE_SIZE, THREAD_SIZE) #if defined(CONFIG_ROMKERNEL) #undef ADDR #endif diff --git a/arch/hexagon/kernel/vmlinux.lds.S b/arch/hexagon/kernel/vmlinux.lds.S index 0145251fa317..0ca2471ddb9f 100644 --- a/arch/hexagon/kernel/vmlinux.lds.S +++ b/arch/hexagon/kernel/vmlinux.lds.S @@ -49,7 +49,7 @@ SECTIONS INIT_DATA_SECTION(PAGE_SIZE) _sdata = .; - RW_DATA_SECTION(32,PAGE_SIZE,_THREAD_SIZE) + RW_DATA(32,PAGE_SIZE,_THREAD_SIZE) RO_DATA(PAGE_SIZE) _edata = .; diff --git a/arch/m68k/kernel/vmlinux-nommu.lds b/arch/m68k/kernel/vmlinux-nommu.lds index de80f8b8ae78..7b975420c3d9 100644 --- a/arch/m68k/kernel/vmlinux-nommu.lds +++ b/arch/m68k/kernel/vmlinux-nommu.lds @@ -61,7 +61,7 @@ SECTIONS { _sdata = .; RO_DATA(PAGE_SIZE) - RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE) + RW_DATA(16, PAGE_SIZE, THREAD_SIZE) _edata = .; EXCEPTION_TABLE(16) diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds index 625a5785804f..6e7eb49ed985 100644 --- a/arch/m68k/kernel/vmlinux-std.lds +++ b/arch/m68k/kernel/vmlinux-std.lds @@ -33,7 +33,7 @@ SECTIONS RODATA - RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE) + RW_DATA(16, PAGE_SIZE, THREAD_SIZE) BSS_SECTION(0, 0, 0) diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds index 9868270b0984..1a0ad6b6dd8c 100644 --- a/arch/m68k/kernel/vmlinux-sun3.lds +++ b/arch/m68k/kernel/vmlinux-sun3.lds @@ -30,7 +30,7 @@ SECTIONS EXCEPTION_TABLE(16) :data _sdata = .; /* Start of rw data section */ - RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE) :data + RW_DATA(16, PAGE_SIZE, THREAD_SIZE) :data /* End of data goes *here* so that freeing init code works properly. */ _edata = .; NOTES diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S index 2299694748ea..b8efb08204a1 100644 --- a/arch/microblaze/kernel/vmlinux.lds.S +++ b/arch/microblaze/kernel/vmlinux.lds.S @@ -69,7 +69,7 @@ SECTIONS { } _sdata = . ; - RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE) + RW_DATA(32, PAGE_SIZE, THREAD_SIZE) _edata = . ; /* Under the microblaze ABI, .sdata and .sbss must be contiguous */ diff --git a/arch/nds32/kernel/vmlinux.lds.S b/arch/nds32/kernel/vmlinux.lds.S index 10ff570ba95b..f679d3397436 100644 --- a/arch/nds32/kernel/vmlinux.lds.S +++ b/arch/nds32/kernel/vmlinux.lds.S @@ -54,7 +54,7 @@ SECTIONS _sdata = .; RO_DATA(PAGE_SIZE) - RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) + RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) _edata = .; EXCEPTION_TABLE(16) diff --git a/arch/nios2/kernel/vmlinux.lds.S b/arch/nios2/kernel/vmlinux.lds.S index 318804a2c7a1..c55a7cfa1075 100644 --- a/arch/nios2/kernel/vmlinux.lds.S +++ b/arch/nios2/kernel/vmlinux.lds.S @@ -50,7 +50,7 @@ SECTIONS _sdata = .; RO_DATA(PAGE_SIZE) - RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) + RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) _edata = .; BSS_SECTION(0, 0, 0) diff --git a/arch/openrisc/kernel/vmlinux.lds.S b/arch/openrisc/kernel/vmlinux.lds.S index f73e0d3ea09f..60449fd7f16f 100644 --- a/arch/openrisc/kernel/vmlinux.lds.S +++ b/arch/openrisc/kernel/vmlinux.lds.S @@ -74,7 +74,7 @@ SECTIONS /* Whatever comes after _e_kernel_ro had better be page-aligend, too */ /* 32 here is cacheline size... recheck this */ - RW_DATA_SECTION(32, PAGE_SIZE, PAGE_SIZE) + RW_DATA(32, PAGE_SIZE, PAGE_SIZE) _edata = .; diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S index e1c563c7dca1..12b3d7d5e9e4 100644 --- a/arch/parisc/kernel/vmlinux.lds.S +++ b/arch/parisc/kernel/vmlinux.lds.S @@ -148,7 +148,7 @@ SECTIONS data_start = .; /* Data */ - RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, PAGE_SIZE) + RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, PAGE_SIZE) /* PA-RISC locks requires 16-byte alignment */ . = ALIGN(16); diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S index 66dc17d24dd9..12f42f96d46e 100644 --- a/arch/riscv/kernel/vmlinux.lds.S +++ b/arch/riscv/kernel/vmlinux.lds.S @@ -57,7 +57,7 @@ SECTIONS *(.srodata*) } - RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) + RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) .sdata : { __global_pointer$ = . + 0x800; *(.sdata*) diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S index b33c4823f8b5..37695499717d 100644 --- a/arch/s390/kernel/vmlinux.lds.S +++ b/arch/s390/kernel/vmlinux.lds.S @@ -67,7 +67,7 @@ SECTIONS . = ALIGN(PAGE_SIZE); __end_ro_after_init = .; - RW_DATA_SECTION(0x100, PAGE_SIZE, THREAD_SIZE) + RW_DATA(0x100, PAGE_SIZE, THREAD_SIZE) BOOT_DATA_PRESERVED _edata = .; /* End of data section */ diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S index fef39054cc70..c60b19958c35 100644 --- a/arch/sh/kernel/vmlinux.lds.S +++ b/arch/sh/kernel/vmlinux.lds.S @@ -51,7 +51,7 @@ SECTIONS _sdata = .; RO_DATA(PAGE_SIZE) - RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) + RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) _edata = .; DWARF_EH_FRAME diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S index 8929fbc35a80..7ec79918b566 100644 --- a/arch/sparc/kernel/vmlinux.lds.S +++ b/arch/sparc/kernel/vmlinux.lds.S @@ -67,7 +67,7 @@ SECTIONS .data1 : { *(.data1) } - RW_DATA_SECTION(SMP_CACHE_BYTES, 0, THREAD_SIZE) + RW_DATA(SMP_CACHE_BYTES, 0, THREAD_SIZE) /* End of data section */ _edata = .; diff --git a/arch/unicore32/kernel/vmlinux.lds.S b/arch/unicore32/kernel/vmlinux.lds.S index 367c80313bec..6fb320b337ef 100644 --- a/arch/unicore32/kernel/vmlinux.lds.S +++ b/arch/unicore32/kernel/vmlinux.lds.S @@ -44,7 +44,7 @@ SECTIONS _sdata = .; RO_DATA(PAGE_SIZE) - RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) + RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) _edata = .; EXCEPTION_TABLE(L1_CACHE_BYTES) diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S index b97e5798b9cf..bdbd7c4056c1 100644 --- a/arch/xtensa/kernel/vmlinux.lds.S +++ b/arch/xtensa/kernel/vmlinux.lds.S @@ -134,7 +134,7 @@ SECTIONS /* Data section */ _sdata = .; - RW_DATA_SECTION(XCHAL_ICACHE_LINESIZE, PAGE_SIZE, THREAD_SIZE) + RW_DATA(XCHAL_ICACHE_LINESIZE, PAGE_SIZE, THREAD_SIZE) _edata = .; /* Initialization code and data: */ diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 061e57c609f6..356078e50a5c 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -24,7 +24,7 @@ * * _sdata = .; * RO_DATA(PAGE_SIZE) - * RW_DATA_SECTION(...) + * RW_DATA(...) * _edata = .; * * EXCEPTION_TABLE(...) @@ -975,7 +975,7 @@ * matches the requirement of PAGE_ALIGNED_DATA. * * use 0 as page_align if page_aligned data is not used */ -#define RW_DATA_SECTION(cacheline, pagealigned, inittask) \ +#define RW_DATA(cacheline, pagealigned, inittask) \ . = ALIGN(PAGE_SIZE); \ .data : AT(ADDR(.data) - LOAD_OFFSET) { \ INIT_TASK_DATA(inittask) \ From patchwork Fri Oct 11 00:05:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184701 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 3D4401575 for ; Fri, 11 Oct 2019 00:13:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1A65F21920 for ; Fri, 11 Oct 2019 00:13:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PZSNK1sb"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Gv7TLEhl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A65F21920 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=bLdp94rbeFQO2wrG/LySkSwywYve+ZdD0+Bq4i8kGuc=; b=PZSNK1sbMhM8lgDjPAPKJf+gyD N1siUOR+VlSYVvh1SrPGmKk4jhkkgd60mvz0Q8C+ESYCIlAsUnVNZXQjL9Hv++qrcU5Jqi37GPgrk AbO0lxeq9yiBRzpJo46S9mQ5WMMHT0Lw7lP9Up705HC48IUZgM0uK9Ohvtnl8c6Lzpx8pI/QEnAos RyBztKf7A/cWZdfB89qIkHUdm6tCGHmzi6JrGJ9UgZz38PiF4sYljApf8r0z+F+MoVHZ9+4R2wSub Ow2y5YobTZL0XjQGW5qKBZKfeFo3oylilk+o2H+Z86OuTQ7x4bBoysZ2QbjXFO+9g2rIjeyckvkpL OS55/rPA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiYw-0002J7-1k; Fri, 11 Oct 2019 00:13:42 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiYB-0001YF-HG for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:12:56 +0000 Received: by mail-pg1-x544.google.com with SMTP id d26so4697693pgl.7 for ; Thu, 10 Oct 2019 17:12:55 -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=O8SEsfE9Vx0Hoh9SzPjKsL9yL1yAPo1QWRZUpqQZ5BE=; b=Gv7TLEhljmk67n05hXgtlXOGcw9tGWMBrimWEdgAzAJXSYD424xsVS93uPgKCKbOtA KpknhwokmtlZdLNepzxzaEOUq/9kMlkIhbFFmT4rtodx7TYV09GcbgOeE2Tx2zJJHzL4 OqaceGT7qpam5Y2W3jNCRpS/l3/Ec0FSl0z+s= 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=O8SEsfE9Vx0Hoh9SzPjKsL9yL1yAPo1QWRZUpqQZ5BE=; b=mOiJLxRCWjBKaXnNGJ/WFFrtaoStHvmEDq0+4yOMtO0OCy6YqNNEh6ajhH/gRy29aN amOiB6xxjCGgESXZEHqqfjt057zudrJ+pMqS8OdQs7vBVrxa/oIukSfqn5wicn9CmSBl kgsl92G6wirugj3U1/xSinFsBTOnL4NOXM8+u54U1hL/bTXT2fpJxwocjB842QLKhH0I 4qrOuvNpMbYJ9UdWbsHsrAjXlCT9S85whbq33CHiLwe/XRtkJPhe7xQMQk0Z9cCBgfzm NxymHZoWJ66srMrpxmQjbiW0ezVnYLUDZHvnKkLGJiGhIWKkxVJX0y5YeZxroXH9U+iS 674Q== X-Gm-Message-State: APjAAAUvVMtvJAwITmKbfVkIZd/TaOvaDn7vaMkubWdMMPshcXGo5zFb dRxJwAihCjl57/JLwYIVyfGusA== X-Google-Smtp-Source: APXvYqzyaJSRYesLvc9/cYfNuiEyqu7JRw4xKIgMuM24rG56rksdn8ZIgzTA7SEJDJgU0X32uEGKXg== X-Received: by 2002:a63:4624:: with SMTP id t36mr11232771pga.376.1570752775059; Thu, 10 Oct 2019 17:12:55 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id 2sm6371584pfo.91.2019.10.10.17.12.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:12:52 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 14/29] vmlinux.lds.h: Allow EXCEPTION_TABLE to live in RO_DATA Date: Thu, 10 Oct 2019 17:05:54 -0700 Message-Id: <20191011000609.29728-15-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_171255_574858_6954B723 X-CRM114-Status: GOOD ( 10.70 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:544 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Many architectures have an EXCEPTION_TABLE that only needs to be readable. As such, it should live in RO_DATA. Create a macro to identify this case for the architectures that can move EXCEPTION_TABLE into RO_DATA. Signed-off-by: Kees Cook Acked-by: Will Deacon --- include/asm-generic/vmlinux.lds.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 356078e50a5c..9867d8e41eed 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -69,6 +69,17 @@ #define NOTES_HEADERS_RESTORE #endif +/* + * Some architectures have non-executable read-only exception tables. + * They can be added to the RO_DATA segment by specifying their desired + * alignment. + */ +#ifdef RO_EXCEPTION_TABLE_ALIGN +#define RO_EXCEPTION_TABLE EXCEPTION_TABLE(RO_EXCEPTION_TABLE_ALIGN) +#else +#define RO_EXCEPTION_TABLE +#endif + /* Align . to a 8 byte boundary equals to maximum function alignment. */ #define ALIGN_FUNCTION() . = ALIGN(8) @@ -513,6 +524,7 @@ __stop___modver = .; \ } \ \ + RO_EXCEPTION_TABLE \ NOTES \ \ . = ALIGN((align)); \ From patchwork Fri Oct 11 00:05:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184661 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 0790B139A for ; Fri, 11 Oct 2019 00:10:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AACA8214E0 for ; Fri, 11 Oct 2019 00:10:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ACDz8P0U"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Cke1k+Wo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AACA8214E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=kfPrpDtDFoiR8Wp1yAvZy9qeXPNEkqFB+7XnkDykLvk=; b=ACDz8P0UpK/5N1aP2FvKwx/28s kqY+INVP6FiKOS5jQGtkjUmXVzUmsonN5lc17hLefOO4+QEuUMOtm5pmRK4Gi5UJnh7mgWuExweLA 46eiaJxPRzNSs8es7Bpo6+u8nL4jPfp/Pp+/I6TnVSizvWtuUVG+jEa2LH4KqezqrTCy47utlfgjc FWQfZBM6ThurI8S88n4SyCI8AgYpH7ya0Il7FrQQYIGlZC0RSLJHN35fv7y3Iz6ZXnDnvYlnyGvl6 DIiSGFAOnsIgnaNRPsshEiGNT5/64wW61w7FnQjn30OHN+zyws2ai/VRw+wRQ7p+kvra+B1Ej0vma tbvZ1JOA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiVg-0008QR-QJ; Fri, 11 Oct 2019 00:10:20 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiS4-0003j8-FU for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:06:40 +0000 Received: by mail-pg1-x542.google.com with SMTP id z12so4689127pgp.9 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=MEsYo+M8tYJs19WnuB4vdd58NV32mqrr8UAWRisKZTU=; b=Cke1k+WoV3d4y7UYLwGR6Cccr6ntETV7w4A+pAdyCIZxanwHXq4EPnvgyBzqAj40+x LiPrWoEPAyegIEPYdAPySyJ4W/aeyE2yAl3to28d7+EqgEkXRjB2PlBmPUXFz9yU7bX0 btdMvXUw872LvztOLh6mK1NAcmtdiy6tXBqrQ= 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=MEsYo+M8tYJs19WnuB4vdd58NV32mqrr8UAWRisKZTU=; b=eab8L+hSterkd5WSnwR67/VyqlXnRjo9+wn7FWXiLblLWmL7UtnTolDJ3iuE2Pdzem 6EjhDkiZz2vekCS9c0za1DRnWnDhXQgtQJRbsMBq+XrVJWMUH2eiNO7hdRZJZAz6AI2n a/IBHnMEO6Xz4OyqXLtNerJgnj3t4VE0FFosjkvhWM5C8ECa9akZbOOwrKUPdcVKZrhI sIU8HjnFCUVOQBy0rfIHVhxQkskWHeUefT2JuBxRnC+sUs/OYL7x6lMJvITumtWwjs0E xxSYWO35mXhKqQkXQ0U+f9/p8ixoMo9cjVvSqH4Gp+qNcmGa8prXRk5zOWXs6cQJlzBF XH0g== X-Gm-Message-State: APjAAAX7rnw25dK88EpZukYayX5uIN4zaPG3KOZf8DHYugxG1kbJgtaY j4DwNSLDMA4c6HaLqsp/yq5SLQ== X-Google-Smtp-Source: APXvYqzt84R7YNxqDtZOc2Oqf/NMK/JV4QC0qvTQklX1v+jaEWwrU8bF8lAwLpkYEhqywmtQWhwmNQ== X-Received: by 2002:aa7:8691:: with SMTP id d17mr13279534pfo.218.1570752395513; Thu, 10 Oct 2019 17:06:35 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id y28sm7193083pfq.48.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 Subject: [PATCH v2 15/29] x86: Actually use _etext for end of text segment Date: Thu, 10 Oct 2019 17:05:55 -0700 Message-Id: <20191011000609.29728-16-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_170636_643616_5AB83021 X-CRM114-Status: GOOD ( 14.43 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:542 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Various calculations are using the end of the exception table (which does not need to be executable) as the end of the text segment. Instead, in preparation for moving the exception table into RO_DATA, move _etext after the exception table and update the calculations. Signed-off-by: Kees Cook --- arch/x86/include/asm/sections.h | 1 - arch/x86/kernel/vmlinux.lds.S | 7 +++---- arch/x86/mm/init_64.c | 6 +++--- arch/x86/mm/pti.c | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/arch/x86/include/asm/sections.h b/arch/x86/include/asm/sections.h index 71b32f2570ab..036c360910c5 100644 --- a/arch/x86/include/asm/sections.h +++ b/arch/x86/include/asm/sections.h @@ -6,7 +6,6 @@ #include extern char __brk_base[], __brk_limit[]; -extern struct exception_table_entry __stop___ex_table[]; extern char __end_rodata_aligned[]; #if defined(CONFIG_X86_64) diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 41362e90142d..a1a758e25b2b 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -143,15 +143,14 @@ SECTIONS *(.text.__x86.indirect_thunk) __indirect_thunk_end = .; #endif - - /* End of text section */ - _etext = .; } :text = 0x9090 EXCEPTION_TABLE(16) - /* .text should occupy whole number of pages */ + /* End of text section, which should occupy whole number of pages */ + _etext = .; . = ALIGN(PAGE_SIZE); + X86_ALIGN_RODATA_BEGIN RO_DATA(PAGE_SIZE) X86_ALIGN_RODATA_END diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index a6b5c653727b..26299e9ce6da 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -1263,7 +1263,7 @@ int kernel_set_to_readonly; void set_kernel_text_rw(void) { unsigned long start = PFN_ALIGN(_text); - unsigned long end = PFN_ALIGN(__stop___ex_table); + unsigned long end = PFN_ALIGN(_etext); if (!kernel_set_to_readonly) return; @@ -1282,7 +1282,7 @@ void set_kernel_text_rw(void) void set_kernel_text_ro(void) { unsigned long start = PFN_ALIGN(_text); - unsigned long end = PFN_ALIGN(__stop___ex_table); + unsigned long end = PFN_ALIGN(_etext); if (!kernel_set_to_readonly) return; @@ -1301,7 +1301,7 @@ void mark_rodata_ro(void) unsigned long start = PFN_ALIGN(_text); unsigned long rodata_start = PFN_ALIGN(__start_rodata); unsigned long end = (unsigned long) &__end_rodata_hpage_align; - unsigned long text_end = PFN_ALIGN(&__stop___ex_table); + unsigned long text_end = PFN_ALIGN(&_etext); unsigned long rodata_end = PFN_ALIGN(&__end_rodata); unsigned long all_end; diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c index 7f2140414440..44a9f068eee0 100644 --- a/arch/x86/mm/pti.c +++ b/arch/x86/mm/pti.c @@ -574,7 +574,7 @@ static void pti_clone_kernel_text(void) */ unsigned long start = PFN_ALIGN(_text); unsigned long end_clone = (unsigned long)__end_rodata_aligned; - unsigned long end_global = PFN_ALIGN((unsigned long)__stop___ex_table); + unsigned long end_global = PFN_ALIGN((unsigned long)_etext); if (!pti_kernel_image_global_ok()) return; 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: 11184663 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 2D81A139A for ; Fri, 11 Oct 2019 00:10:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 07FA5214E0 for ; Fri, 11 Oct 2019 00:10:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FA03rC0O"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="fLT/IFk/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 07FA5214E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=wI6DcODXcog0rHPfEA/Eo0qNwMDFBV5X2a58BUYMqcY=; b=FA03rC0OBw80zI0uLBE5hUWPfh QGI1vQSnKtlf5ABWMjngaArnhSb7VHEBUmIb88aMYz8hWkqJ9BevPgppNzE8lpA0PCk3SlxX7rgOI eiR4EDf5eXUpLTpR1doaJwdrgs6AVoc6ybP8mccWHHJcTdvDpXPh7n4hiTbhcb1Zl6qM885iV4Xnm XhVJAUEvEh33rGH9833e2EOY7tdXza+YJGlCCixnmodFL0HJTGoZVE00+/tY6g19KSy9xGFXSuRDa LRp0CqeT7QxSttoFF+NP2ck/+yIQuzUaSg3Aqe6VyB0yQqMCP3OCZV98OkSlJL1j04HFqugWGFS4y wG43Yrpw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiW8-0000GT-0H; Fri, 11 Oct 2019 00:10:48 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiS3-0003iK-Nk for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:06:39 +0000 Received: by mail-pg1-x543.google.com with SMTP id i76so4704838pgc.0 for ; Thu, 10 Oct 2019 17:06:35 -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=Bgo3/lNAFa9G4pDeXMqET35Tm5q6iGpaKu+5DvIyDsKULg4ezEt2Bmt4mWz55IVzyI NTnA9L6Ru/ZByvpXjVFdLj1dMrnjjbSry4BUD4+xJzdVOW4HNAlHiZCyU+I8jADWhy3Y JHqDRHdoJaAbqlMPxz2SfSaChYGRS1afOWbQqWI/Z7QYNqB9BuePoq7ag+jTAkvdOiM4 p8A9FUJz98VS6WRuWnf3hU9XtmZJBxEKLVMRjsoGY047lGdyLwGA3OzHp7lt7PdjtSRk Aea+x3JEZ/wAFOiywPcei9xMiSxq987CAZLMqcA7FdmAUHmQSkgIVsle3uPTGNl443zG N9SA== X-Gm-Message-State: APjAAAWmFvZdCJ/Mcyxega0oUZoxS5/sLm2AoFuegqRWyblGoCtAZjwE 2Mf/iEDT/m5XBMF830CmmcBLew== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_170635_966198_92E3733E X-CRM114-Status: GOOD ( 12.90 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:543 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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); From patchwork Fri Oct 11 00:05:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184671 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 B95C1139A for ; Fri, 11 Oct 2019 00:12:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8CFAD21A4C for ; Fri, 11 Oct 2019 00:12:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="eMw0vQyd"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="UICOc5TK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CFAD21A4C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=n8DeqocfraIIkVa8+gsevviVEbY/VpH0359DpUjn/v8=; b=eMw0vQydv9YcdAhf5kMSEZ8N4h ZPqr74wLKQQ7UdoezhuSggAb+LcaVJKH2yqxYBOixUDINYNTwvVngum9ognrRA5q+kcL5uwOJV3Lw 0ucYjLRmQpfnzkKiRfUYdoHKYhh/pgK2cuIfwi8YO82wO/eXZOol37NdPLmEpPrIwsRTmPQsiiCVu K3yjo7ZUExxqpq2m5j4XpqxU8lnq4CiPvT1Y6duFjzUaCMgIg3L4a3x7J4P6xyj5NxUSxbyVefaKw ySkUTSEinzrxrArJpnCdXCR3dB6Zyq9s7LDWjtK4nqFsKeJ8eKPZI8O6IXQ9Y8ZdX8rYxpaUJhuT5 RVfw26DQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiYC-0001Ym-4t; Fri, 11 Oct 2019 00:12:56 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiY9-0001XJ-NJ for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:12:55 +0000 Received: by mail-pg1-x544.google.com with SMTP id p1so4699952pgi.4 for ; Thu, 10 Oct 2019 17:12:53 -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=C4qrRt1wPf/MBbE+aHUnjpKB3JMiaG6wbnmkvfoIFU0=; b=UICOc5TKza9BTCIUokRpRXRixWvfiu//j+nLFORdk7UGk/JwyzBWx+ycolyJCZr/Zj USYjJEh9S6rYvbkeSR5dqh4t0wO42rK96mEpNN2uDcZMnixq8tbOTsEogIYGcWgVfWSY D4i8QsjQVcM0qjRwO2F5cvKbTZ8BLcWZFx7T8= 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=C4qrRt1wPf/MBbE+aHUnjpKB3JMiaG6wbnmkvfoIFU0=; b=PWwazqIb90TOtEZCD/9rzuSPwqYNRdVJbP/ye3+mY2Q5Deojkk066bm+XGVtUR98ri MhpFI3bZspYDcKURBkKTZ712e+xVfi46Z/EU/N7B2Gvg4qHV9IUrnIzk2B/wwNjC55s5 HNWkPUT0883EtuMh50fCCXlkD4/uhSaQRxxcXEQLZNZsi/k9tDF1zBTH9fxqbUgHBkbw G7ydSlNtk7N26LM/yqYZu5X1mQ3Myyui+0nBd4RJfrBL/fOLuOpFW5ifnEz/Mx7vkmCG kU5N1y3gpfLXpYYw4sSTFXfAjzSt9DmupduAkV58XvhHsfXE39Vnm2AxeviTS3enR9WM ogrQ== X-Gm-Message-State: APjAAAV71R++hdHWrBihMhBUMz2Pr7nwtI9y1Rb2n6XBhemRYMNcEIBQ CxnikJehoD97tlUL03/v39lJBA== X-Google-Smtp-Source: APXvYqwliD8aT2m8D5BS3pRkZKxejc1RX6nlHmvajkiWktD94kckhfSBhz7/A5hJ2lTUaMfRy1yv0g== X-Received: by 2002:a62:e206:: with SMTP id a6mr13749471pfi.245.1570752773224; Thu, 10 Oct 2019 17:12:53 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id w2sm7937638pfn.57.2019.10.10.17.12.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:12:52 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 17/29] alpha: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 10 Oct 2019 17:05:57 -0700 Message-Id: <20191011000609.29728-18-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_171253_759323_A8296A5A X-CRM114-Status: GOOD ( 12.92 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:544 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Since the EXCEPTION_TABLE is read-only, collapse it into RO_DATA. Signed-off-by: Kees Cook --- arch/alpha/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S index edc45f45523b..bc6f727278fd 100644 --- a/arch/alpha/kernel/vmlinux.lds.S +++ b/arch/alpha/kernel/vmlinux.lds.S @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ #define EMITS_PT_NOTE +#define RO_EXCEPTION_TABLE_ALIGN 16 #include #include @@ -35,7 +36,6 @@ SECTIONS _etext = .; /* End of text section */ RO_DATA(4096) - EXCEPTION_TABLE(16) /* Will be freed after init */ __init_begin = ALIGN(PAGE_SIZE); From patchwork Fri Oct 11 00:05:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184709 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 96F281575 for ; Fri, 11 Oct 2019 00:14:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 549A321920 for ; Fri, 11 Oct 2019 00:14:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QqsIIoX3"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="P4Fuk21m" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 549A321920 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=LUHhUAFbADyO2b3DuTeZerd2KkKMnevpM7O23GqruUU=; b=QqsIIoX3OEwI7vD+X2eR7gSW+C FIXJ5qcJivJHY2FFZ4fKbYmJq1W7WGKFxwkeYTkHCOR5zTh/aFERScu6xY0pRu3AqBQoJhdZmvKvH XjYLyotThWOXFUwV9B9bmICoRpOUyiQkDcpni+hqpGZncuLGnrJV0UbUw3bGGPHiTLFRmJVqIoZmC aFyblwfrBZouox76q3ROXg5w9pNS/PyZ/Gis6chiQ5c2vnMzMD21PEoM1dWSEadkbN3Pua71mF+9g Ucg47qd/DdJgeC4p/ExyMDUtnb+pASeycZ2YY/KNijoMDIeislG8Ne+OkYMIRIFNhV6Wh8r9ARMMN qUW+9xaw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiZx-0003KS-Fa; Fri, 11 Oct 2019 00:14:45 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiYG-0001ek-Lp for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:13:02 +0000 Received: by mail-pf1-x443.google.com with SMTP id v4so4954720pff.6 for ; Thu, 10 Oct 2019 17:13:00 -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=FW8b8NX2lcqvjxUkqurmeLymDZQTO5emHjisNR3IdMA=; b=P4Fuk21mSaKNwFMUmZxSt/IIxNtkXj+Ys/JxlgIct6Hlb4B3yXk/i320iivrHPWx5w hPi5AFgp8NwZicAqmOBJvk6GzGKldRwbd/3LLSi/srLk+eGZ7yRithSSv41nscZhF3Dk GELZr5uH3JzvVYuz2LSeaVERr6mu//7mpofAQ= 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=FW8b8NX2lcqvjxUkqurmeLymDZQTO5emHjisNR3IdMA=; b=tmEyAlzgpqnMDwCwOnifHY4E0BnDVOBqicUyhkapLHaVTo4ZJGCXbzSIG4t1FLR1aY AvfyiCCkJZ8rn57JuEr4zpB6m1RfyrMs8Pnf71BJMnZg1737WrxKWwxgdRLwQal8dTHA nJfCyPwvbcbWkQy5/U9vhslbvvMo329TDL2udSw6sU9AbB0yIFqpoynWGWJx0sURDAMc n9lXK0GxZ3pviUknTyD8XYtMry00AFwoTfR/wKKlMPlTZA7C5wyMk7vC9af66DV2sswW j83w14IOO1ro4CX6MDBoTU46TxAorMZgSfpDHnOnvyBHzABzuOZRrQAX1yy6oCn947j7 A6og== X-Gm-Message-State: APjAAAXDIhdzgusqR3UPvwDiGZ+2Ccsh9rJcx3Mo9lPx8ED9Zcdnk0Ss xHfswrVT6ShXH/o+yeBHBbkW0A== X-Google-Smtp-Source: APXvYqwSt3lft0x1k4gSFxtu2q9aicPcZGAiZFY9usQRrxAus3R2IZvqQ+Z/MfqEoiJ8yKOquglteA== X-Received: by 2002:a17:90a:246e:: with SMTP id h101mr14385157pje.133.1570752779910; Thu, 10 Oct 2019 17:12:59 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id 7sm5985112pgx.26.2019.10.10.17.12.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:12:56 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 18/29] arm64: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 10 Oct 2019 17:05:58 -0700 Message-Id: <20191011000609.29728-19-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_171300_728467_47BA42FE X-CRM114-Status: GOOD ( 11.90 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:443 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Since the EXCEPTION_TABLE is read-only, collapse it into RO_DATA. Also removes the redundant ALIGN, which is already present at the end of the RO_DATA macro. Signed-off-by: Kees Cook Acked-by: Will Deacon --- arch/arm64/kernel/vmlinux.lds.S | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index a4b3e6c0680c..9128a26eb45b 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_EXCEPTION_TABLE_ALIGN 8 + #include #include #include @@ -135,10 +137,9 @@ 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); idmap_pg_dir = .; . += IDMAP_DIR_SIZE; From patchwork Fri Oct 11 00:05:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184707 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 5A690139A for ; Fri, 11 Oct 2019 00:14:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0AAA421920 for ; Fri, 11 Oct 2019 00:14:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FK0EGv3O"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="C1PlvZ+0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0AAA421920 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=iWi6YdQXyEhRXZdL0IkFDNMpY9xz8Fj9+Xf2RAT6fU4=; b=FK0EGv3O9wlmSUBOoF/URqVpuC KwENiaCZfEb8pqwFvv8BYNw75ENMMDlm3V4kvu94KTufXmVUjYAXPjboIEEhX7F+lNppkMK9oPGjj 7wYyWgcTU8uGsFvzddxrRk5pCNRQmMcEwvMBu/vazU+HmQ2txN/Zn8v+9iY+gvinJQygdzGdj+Ne6 q1wqxRySFWS2NqbALZRlCVsamyzqx8Rcla5Dv59CZ87Ou+ILoYbRcOtFWC0lSrsynLKSbjesJeCm8 xPI7wgt0ADeLt6mbXR00wUDj4IF6NCKPEhPtCC0tcBNcbjcn1lVPuowmJrmBSvN/s+jFebPiCpJsM pykXPZ7g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiZd-00032h-U4; Fri, 11 Oct 2019 00:14:25 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiYF-0001d3-IG for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:13:00 +0000 Received: by mail-pf1-x442.google.com with SMTP id v4so4954690pff.6 for ; Thu, 10 Oct 2019 17:12:59 -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=l+J574mlC+dRmZJG9pHhpppQFEze5VvTPTaNiTnbyaQ=; b=C1PlvZ+0BEdj9jtliX0A0Huqq47ruf9nBVH5STuBjosSplWIN8Wr5Bj0uznajZR412 88yKrget+DCqKxVlllcxd6K5szWGkcPAUypn6xoncOXOV6R6YV83ztEsCSkeh78n0AI2 yKxfXdh2vdcul3D71BzoL2J/wyWHTxCQ4Jyq0= 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=l+J574mlC+dRmZJG9pHhpppQFEze5VvTPTaNiTnbyaQ=; b=OaeKHZ4sxDAhWIFZL1bVD3b2hNYcU/NIRNOe+RDWDR6HjOlBAasmsUTKy30HelSF7t lAqxW8k0UIqozeX8QPdcCZIPE/IklC2+7kGgMq1Nqu9ZGOxLvv3WEakAgwa7RkNLORe6 GLCV+dJ8FeEz71ZS6v2PAK5pTxNeOHigvqiGFfQ9jL44EJO2pOYkxcfYYSQYxEaTSfpN wukIBhNSkgCjlEausZj6M2uD6MNG3Br12o5vYj28TBuaA9/xR7ckroQGjG4qVpJH97X/ XWyFkcVbACGhFPBJapWU0Hec4qR6fW04WJJIk/f70eoL9yJhZELqp8coonY+NYLZ/X3h Dxiw== X-Gm-Message-State: APjAAAVv41ZjFQmWz8HOzrbg3eyEOpEVhH1hQtDXMjpRoC2VfhiJaRkc Yqx+V/dYxbgmcbsLIiMaJ4685Q== X-Google-Smtp-Source: APXvYqy4PLu05rX5bRRgJJfyDhm9F1ghOcCs3VwNTK0YfAFFK8MX8ZPUgv1lA3bQ8SclnhiYx4k3qw== X-Received: by 2002:a63:44f:: with SMTP id 76mr14137515pge.164.1570752778758; Thu, 10 Oct 2019 17:12:58 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id a8sm7285998pfa.182.2019.10.10.17.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:12:56 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 19/29] c6x: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 10 Oct 2019 17:05:59 -0700 Message-Id: <20191011000609.29728-20-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_171259_611731_4880CCD2 X-CRM114-Status: GOOD ( 11.21 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Since the EXCEPTION_TABLE is read-only, collapse it into RO_DATA. Signed-off-by: Kees Cook --- arch/c6x/kernel/vmlinux.lds.S | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/c6x/kernel/vmlinux.lds.S b/arch/c6x/kernel/vmlinux.lds.S index a3547f9d415b..ac99ba0864bf 100644 --- a/arch/c6x/kernel/vmlinux.lds.S +++ b/arch/c6x/kernel/vmlinux.lds.S @@ -5,6 +5,9 @@ * Copyright (C) 2010, 2011 Texas Instruments Incorporated * Mark Salter */ + +#define RO_EXCEPTION_TABLE_ALIGN 16 + #include #include #include @@ -80,8 +83,6 @@ SECTIONS *(.gnu.warning) } - EXCEPTION_TABLE(16) - RO_DATA(PAGE_SIZE) .const : { From patchwork Fri Oct 11 00:06:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184669 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 CE719139A for ; Fri, 11 Oct 2019 00:11:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AC2CE21929 for ; Fri, 11 Oct 2019 00:11:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Umvn2jAu"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="YSecILoA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC2CE21929 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=4X5IgAoIkdtAuIrXzDvAI2WgBEHgY5aVpgxHe9GlMhg=; b=Umvn2jAuC/sl9VyYbhlNS3Mnjf XcWP/iQo66pdtWY+0QGtSXfZMKD0kE1qAf0HYUEQ8c2QQ4L6+c7IG3RJdsSVuAN7DyNsoHGJhqram MvdN1QJv6i34LbOfNROiEPpmxmpFqXy1rvpUkzuvsFOB7esj3rD7BCXt+KXWpMHAqGUa1DC6aKDsj 9CY4dOMM1Aeekko5EKeqqHha0hPmAIi2yhoor9fL6Kz6U5fKtbjFNGkM+m98Fph7Hmo0a2P4rB9RN 1QxfyER1FzQ5QeI3JKYwNFQ96hHY5snYHhEBLSUb6q04LImMOdoJqk7H5Buzz9wqA6+WrwQGMtIUt wnsUR1Iw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiWX-0000k6-9H; Fri, 11 Oct 2019 00:11:13 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiS5-0003k4-5U for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:06:40 +0000 Received: by mail-pf1-x442.google.com with SMTP id 205so4958546pfw.2 for ; Thu, 10 Oct 2019 17:06:37 -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=zkQRciK9mkrlSR6uxFsvjRswhc34+65nZ5EFVAGwQNE=; b=YSecILoAsuaYNC3glukrCd31elBfhWrMe0PzbA6TDXYdPOVhmOhkQLy8xjOVCWTle3 sWZgpOp1PTW2fO+D3A347Fw7oous07bPkmNpp/aoq4rj0PLZ+w9ksZu6jr+caikG/bpH XU/ce13E03H0+EglsamH4gM2AQvQFCYts7cLo= 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=zkQRciK9mkrlSR6uxFsvjRswhc34+65nZ5EFVAGwQNE=; b=NMlR7rUm8//rlPr+k4qi72k3LWwyD4z0cYub32cY7VY+Te8HhRhsMVyMpFlBlkfZ6L nEh7HVhKs0hepbXwOpIIYgY5cx8b+u0p6A+BbD5G2DBnhKkI0EaH8sdwLzFf3CBAqZsh y4X/mscKH61pr8ulkxkmZYzSEKTzTQ5phbqof4Ln0OqHyr9OJLYbznQtQg2ZH/n1pcMD 0PHPHOYtGhLyom4O8wDzB3tvSYmMz7PkxAoW9HJ8Q1rvhZjz027nhXWHY99unIKA54sD d4zlLTWeEg7CzVQ92Vb2cuAFBck2QICXT5820KrHba9hBrsO047AMXbVDqZ6ngktvXhe 9wMA== X-Gm-Message-State: APjAAAXBHClaNuRCeTWH3OOlMRpao1i1wzIkn4ABxVE52EqxUgRkw1aT w33YhR3EjmhUJRUNduzZtpci8A== X-Google-Smtp-Source: APXvYqynxI+SrUE/IFh3H47ImD9d3o8Z2E9DLcjnFNC1TbOkJf20nhWWRMuV9Tda9+s+1NYxkhzhYQ== X-Received: by 2002:a63:2c7:: with SMTP id 190mr11717225pgc.18.1570752396275; Thu, 10 Oct 2019 17:06:36 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id s141sm8901750pfs.13.2019.10.10.17.06.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:06:33 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 20/29] h8300: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 10 Oct 2019 17:06:00 -0700 Message-Id: <20191011000609.29728-21-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_170637_328995_BE7C75DF X-CRM114-Status: GOOD ( 10.99 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Since the EXCEPTION_TABLE is read-only, collapse it into RO_DATA. Signed-off-by: Kees Cook --- arch/h8300/kernel/vmlinux.lds.S | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/h8300/kernel/vmlinux.lds.S b/arch/h8300/kernel/vmlinux.lds.S index 2ac7bdcd2fe0..6b1afc2f9b68 100644 --- a/arch/h8300/kernel/vmlinux.lds.S +++ b/arch/h8300/kernel/vmlinux.lds.S @@ -1,4 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ + +#define RO_EXCEPTION_TABLE_ALIGN 16 + #include #include #include @@ -37,7 +40,6 @@ SECTIONS #endif _etext = . ; } - EXCEPTION_TABLE(16) RO_DATA(4) ROMEND = .; #if defined(CONFIG_ROMKERNEL) From patchwork Fri Oct 11 00:06:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184705 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 72910139A for ; Fri, 11 Oct 2019 00:14:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4D6E321920 for ; Fri, 11 Oct 2019 00:14:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uabN8ofk"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="WAsHYQaw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D6E321920 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=J7q5MXenfhesd6CF0Ps9Yk46KNvn7XBw4hgmBQaWR0g=; b=uabN8ofksGYBAEaRbz8VSchJby mNEKPMJohcs9d6sJNeBbmLFnUxGngpAAEPf/IQ1H8Gnb0Ald8b+Tsh4gRWe+Q7/vrWBknX4v/box6 K2ByxkSdEAsFicRtYV7aVN+p7H85zsjqEqkoR0+O+y/Qs1JyAfUQ1FlpPneRNH0AiKwBHcGXAayYz mv9AQZlmX9vIMEY9i7ySx3YqlR0zwD9cME2vi65ozdsantBb69eSOB//pmA4QsiDJ64EUuIDzcLdf 8EXmVj2JzCdxfjzJyeJB7WWywRbi9Y54wLlrv3IoBwU4I0Q7oY1tSsNjCBRw51RF0Uaq0JKDfCl1q e+MZaUqg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiZT-0002qz-9f; Fri, 11 Oct 2019 00:14:15 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiYE-0001by-WC for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:13:00 +0000 Received: by mail-pf1-x441.google.com with SMTP id b128so4969941pfa.1 for ; Thu, 10 Oct 2019 17:12:58 -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=BONbSwO3yUZE8RnSGxOUsa1O5SfUej1bEo+UUtcRz+8=; b=WAsHYQawMi4SZmZgp8/tZRHbrTyjaN/efP/1ePAdIKhuzenhHAkQSemi72oSFyzy5T BUP8VJmLQCYcSjbNgTQmhLF0rh39giv7Aj/ab5NbcDAnNRa5xqPwvle+ummM9Ru1MTnT 6FSY7l03L75U7xLgPLADUTO/JJnoTeuiDWO4o= 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=BONbSwO3yUZE8RnSGxOUsa1O5SfUej1bEo+UUtcRz+8=; b=ViMJc4r52CMDP2Dpb+l9Pq48p2tjOWcvuItQcMv6mwKBNAeCnr2tpwj03oqz1tr5+U fa6ifnCxjLQP45pxRaZDCEJbuRllzmr063YjRqnisqtM+YeWQNfp4E4O8h8mJ28yId+k 11LWalS2ibbuzTLtCtDh8FcjcwBKCH12PzP+8zUGhw+agzlE2tcs/HqWNODKbVVpdbfZ Njl8o81w5tO0ll5Ni6rSHvHAXDxwv8+x0YNdFD4S6sRcKDQ2Q/L7dRuwLpzC0ZU2qpnu jr2QmJxVQMLIlcUFhHKFAtAxDCQB6QKoJ26VIRMD92AbyXEOsIvkDjza58HoH1iG5PaH xz1w== X-Gm-Message-State: APjAAAVFVtK9X7B1y5fcSXmC9EcZqn4A19n1LX+oxeM5XOBGft51x2oJ Ib1i1gl7k56C7Kce2O5HCJAT0w== X-Google-Smtp-Source: APXvYqxI99kv+xtRG2LlmRclYNJDw1iNLuQgHN4M3GLkprM+ZRb8jXZUnF9huFcBlH1wmB6a5xQwdw== X-Received: by 2002:a62:5284:: with SMTP id g126mr13294604pfb.95.1570752778224; Thu, 10 Oct 2019 17:12:58 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id d5sm5379454pjw.31.2019.10.10.17.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:12:56 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 21/29] ia64: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 10 Oct 2019 17:06:01 -0700 Message-Id: <20191011000609.29728-22-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_171259_060131_2ACF8214 X-CRM114-Status: GOOD ( 12.91 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:441 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Since the EXCEPTION_TABLE is read-only, collapse it into RO_DATA. Signed-off-by: Kees Cook --- arch/ia64/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S index 11d5115bc44d..1ec6b703c5b4 100644 --- a/arch/ia64/kernel/vmlinux.lds.S +++ b/arch/ia64/kernel/vmlinux.lds.S @@ -6,6 +6,7 @@ #include #define EMITS_PT_NOTE +#define RO_EXCEPTION_TABLE_ALIGN 16 #include @@ -70,7 +71,6 @@ SECTIONS { /* * Read-only data */ - EXCEPTION_TABLE(16) /* MCA table */ . = ALIGN(16); From patchwork Fri Oct 11 00:06:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184703 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 74F981575 for ; Fri, 11 Oct 2019 00:13:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3B37721920 for ; Fri, 11 Oct 2019 00:13:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="La0yQf1J"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="VJjnLJGI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3B37721920 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=r/SAx91T8UuKZZXYtV6jp3eOeLKN32bUsQnGOaZw8v8=; b=La0yQf1Je49PkBg6BiuGrhfyW4 p6ZgwxjgG2jbDQg8FbH07iFvBwqQUKPKTWS9HscykFMlH1TgK4KbX6QIc0pD+khZFzs6+tGCbw/Im pwxw0vKrvjyOQ/CQuW5AxXivA27jYNWXFT14B6OWOzXearWQyGPW/25Av2DoRijj/xdlv2c7ucNNM wEAeq2Y8SCPYD5qmwLe66vM6qvvjucUkiQoHoFowh7HJhinjLZ9c4/22kLsA8FDGL4aIbkimfC0Xv U7Uaqms3kT7r/wRfu3XL/QnMfI5jhfTMuUO1Q1skhDVAZqx67kNG7VXT7QtDFudZTPJIg8iSEqftF TjjctJ3g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiZ8-0002X5-HJ; Fri, 11 Oct 2019 00:13:54 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiYC-0001Yr-AD for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:12:57 +0000 Received: by mail-pl1-x644.google.com with SMTP id u20so3595603plq.4 for ; Thu, 10 Oct 2019 17:12:56 -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=bvYKnL/TaFkIaenIAvKRMlAb1gjfrMgYQ33pk+cyLNw=; b=VJjnLJGIO0uGgKBCPhgyxZ/iGefUMJczEPz55L/NXxQm4X5HtH7Z6IwSEISlxXbPIi 0AKWMzRKkEkFoTXpqSQ6so/StMfOF2yJFPqmtCJOuv0Jt6L5qcDOFqlnVgUtBy87cn2m oVq9vePrz89q5V3+gDCK4GhXWqgAgeYpXsYQQ= 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=bvYKnL/TaFkIaenIAvKRMlAb1gjfrMgYQ33pk+cyLNw=; b=RHv/ei0jd0h97IxlKKd9Oq7O67rWuvEd0OJjyPTlREwbQ2iz2lPefL8l8GmsZA7qky K7FBBDMxBog7HLCNyyp+WmzAeWMWvcJxCvyLGmwJIG96dqffUaCOvGvSL8zdHPhZg4Em +5DaRYGvLpgJs9W7ppoHc4KejXpoB+cQkX58mCZQWqGxCDApFF9E0dTQpWMYzPD0zcNF gbROPAGpTZynompX3U8bWZ30jshuePR4RLoq8ecJT0/eM3Qen3D3HI6ROiwHy4as23Xf /Jz5mP1G0UUwfgL1c0xUNmJ/h7R+KwpdikdeYPI/2QYEEo53ja7okz19hflmBEf7EL0O i6Aw== X-Gm-Message-State: APjAAAXxYu64dWurNkNJWhprUvhLJWwZifdlsxx11DcHlpizFzfX7kXV 9Pjmlyf1moQVECOi84DHIgOxnw== X-Google-Smtp-Source: APXvYqz1nJHbdicuisYaMkUGL4dW9cHVrS4hPr3bZVo4nTa2ffJhe6O1BBJ7QgwtCPb4vvcDzPVB3A== X-Received: by 2002:a17:902:b410:: with SMTP id x16mr12316640plr.46.1570752775741; Thu, 10 Oct 2019 17:12:55 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id j128sm7319082pfg.51.2019.10.10.17.12.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:12:52 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 22/29] microblaze: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 10 Oct 2019 17:06:02 -0700 Message-Id: <20191011000609.29728-23-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_171256_381997_5F793BD4 X-CRM114-Status: GOOD ( 11.71 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:644 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Since the EXCEPTION_TABLE is read-only, collapse it into RO_DATA. Signed-off-by: Kees Cook --- arch/microblaze/kernel/vmlinux.lds.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S index b8efb08204a1..760cac41cbfe 100644 --- a/arch/microblaze/kernel/vmlinux.lds.S +++ b/arch/microblaze/kernel/vmlinux.lds.S @@ -11,6 +11,8 @@ OUTPUT_ARCH(microblaze) ENTRY(microblaze_start) +#define RO_EXCEPTION_TABLE_ALIGN 16 + #include #include #include @@ -52,7 +54,6 @@ SECTIONS { . = ALIGN(16); RO_DATA(4096) - EXCEPTION_TABLE(16) /* * sdata2 section can go anywhere, but must be word aligned From patchwork Fri Oct 11 00:06:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184689 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 06FCF1864 for ; Fri, 11 Oct 2019 00:13:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D67B421929 for ; Fri, 11 Oct 2019 00:13:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LOGs2yBd"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="H+PGC98b" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D67B421929 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=9dsSs8HTCxMjNBnbaFsGfz3ypmW+7+8t8a6R0/rYhRo=; b=LOGs2yBdMXQ+UrRaDYQMVxTPMZ s17PJoBgGXK9amRIOzuJZyC9DRE+uGIFj6c1cDrTL/gG28eZeFReEyPtY6Mp+23FZsZvoJeSnlfdz +rdm7O5TQCOQLY9g2rZ7I2tP2NME7fN9qEivPi3WrD0GlRBveJWC488JAbKcB2orbnVHmNOag9hLN dY04keVmvpL24dpyYT0fFJnkRvqIXv7b7zbfDpXm/TGxZ41hgedN2899kuCkywmXWWnaaEOQrjhxB LHX96ug87YokxQNLcJ9NjllIEh5kp7CT18g2tBGZIU8xx1o8sGOsdcmKnF5SRfgltQuQpBpWYpUpF xc9/EnBw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiYh-00024t-Mo; Fri, 11 Oct 2019 00:13:27 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiYA-0001Xu-U8 for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:12:56 +0000 Received: by mail-pg1-x541.google.com with SMTP id i76so4712574pgc.0 for ; Thu, 10 Oct 2019 17:12:54 -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=MdMMErkL0TaCB+AMS9GPl9j3KdOjHrVPYKwcXQnru9o=; b=H+PGC98bol8nQLCHGKVMnumPCpE3rZsdeAzu/63Zl+MVbbl4Sn0Xj0/MJ8+SrojoRq PDLZ+DEdfwhU0nbRPNgAZmDKGI8JIpf0k65nc/pgyy9bqCoX2oIyxBmx8SkXP421+0dD CN9qS2yDtmYN+7Q+QtAoazHu9DvsNkSQPOn/k= 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=MdMMErkL0TaCB+AMS9GPl9j3KdOjHrVPYKwcXQnru9o=; b=AyTrBLeEP0GNDnL0h2vDxfAnrCb/IKKqIYIL6rR+yf3sq5uHGqIBw/SCnxLU/Pc/PZ yqIFl94CdotkuG7WZtcPaCsfwnn+1XiDamp6aoE7WSnrB9Ize5gU8G6GVUTwU0+XMLN0 UVdafZXFGO4SsLG7JjyrI68h1qLFxUQ4EeT/uYEF1qCdXE4PmyKrw4Sa0tUm5LJhO9Fm LgjYujFVxeFEWR0zmZcDJ4AEsh+fbGctYnSgjeUu9gwXzsdSxSezLvvSKgkE3VlUiw17 gt+nhYZkb4Ocsyz3GlmGpNEVrqfotbksTPEd9hA0F1MRJQ432RC28npyoW7DOJ6qMFjl M9rg== X-Gm-Message-State: APjAAAUvDRWSAD4EFmnS6mk4gVkqz2M/V1zQWTXurj/1VXet/UMpUb1M C5huynT0T1JCVoT8J62xyy2UpA== X-Google-Smtp-Source: APXvYqxGtnvXMUJ3pY0jopkR+VKX/LuW1ntTFWY/1XeIzuIP03PlTUnb++z5MjVk9/9/m40WTFaCbw== X-Received: by 2002:a63:1201:: with SMTP id h1mr14569419pgl.340.1570752774490; Thu, 10 Oct 2019 17:12:54 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l22sm6398506pgj.4.2019.10.10.17.12.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:12:52 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 23/29] parisc: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 10 Oct 2019 17:06:03 -0700 Message-Id: <20191011000609.29728-24-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_171254_966207_BE5473ED X-CRM114-Status: GOOD ( 11.58 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:541 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Since the EXCEPTION_TABLE is read-only, collapse it into RO_DATA. Signed-off-by: Kees Cook Acked-by: Helge Deller # parisc --- arch/parisc/kernel/vmlinux.lds.S | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S index 12b3d7d5e9e4..53e29d88f99c 100644 --- a/arch/parisc/kernel/vmlinux.lds.S +++ b/arch/parisc/kernel/vmlinux.lds.S @@ -19,6 +19,7 @@ *(.data..vm0.pte) #define CC_USING_PATCHABLE_FUNCTION_ENTRY +#define RO_EXCEPTION_TABLE_ALIGN 8 #include @@ -129,9 +130,6 @@ SECTIONS RO_DATA(8) - /* RO because of BUILDTIME_EXTABLE_SORT */ - EXCEPTION_TABLE(8) - /* unwind info */ .PARISC.unwind : { __start___unwind = .; From patchwork Fri Oct 11 00:06:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184715 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 CE31F14DB for ; Fri, 11 Oct 2019 00:15:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A0F1521920 for ; Fri, 11 Oct 2019 00:15:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="J9HRIz0A"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Vo/YkX68" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0F1521920 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=JxgXuscmNjUx+3W4Kt8O3fBFelUfO6Yk8d6Cjaqy1UI=; b=J9HRIz0A0+kLab9F2gopqnnPqh Cxw3ksyeIGYKMveVzAbi6XFyUw7KzsduFXCQJ3u7Q4mvYBhv2QmK5oVhiODaEL8hCGgy5DmKbIz9k +OeWaR2vgwxWIFgKkofozTtEsLVtOYadaRoKRsCRkS9mnhF7bwoozNhBuK75RIHgCCnEverPBMjLS FRBpglI1aFxQ2fb4vDht6DvSckQvPJNTEjfrNJ4EPIXLFPHuFQ5y/xiAI9d4OwGDyuX069f5OpBjG RqgUiQXhZMwC/uVG00ZoVUQLe4Ef2yI7Fg0NQxC3Q/WqSRs77Pjl/ML6pKLLgvGY8C58YRRnwi/B1 eb3HPsNg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIial-0005Bb-2O; Fri, 11 Oct 2019 00:15:35 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiYJ-0001hX-CI for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:13:05 +0000 Received: by mail-pf1-x444.google.com with SMTP id q10so4967623pfl.0 for ; Thu, 10 Oct 2019 17:13:02 -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=OvLPSIr20MO1GrkJ0OvwvGngd4/e51+GSaoElj9X+Gc=; b=Vo/YkX68H3JSVeYxOg0wgKZHM0DDpLq1uGIDRlC9At7IoYDSFTbfrL3kzgv//JSf1l wfMMq2ZZ1sw3ulG7OB/Al6Lb7yhUEHFwVbMy0hx6CDWOUEDVNEPAVOGo2TBJff56wZsX 1wJpR43jEKVUBiVd5MS1y8q4VLWL+t/un7fCg= 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=OvLPSIr20MO1GrkJ0OvwvGngd4/e51+GSaoElj9X+Gc=; b=FbJg5ODzWqTtBZAY8we5AFzFm9efH3s8QakzdGrOlHGnY6yp2BbfT9YUo213I34t5f kmxNkxiDpBwERQBpiSMJDPD0s7L7viKITTpkOYrPAIsqEoFxg8+Nt0iFORO+Ug4j30z4 EYCpa08mVdJTHbXrR4ce6RzwR7h44ljpelBOuZHk4eAv86p07c3/dXCDdSPBfj6qJU+f 24EmX0hkOUUIfjbZn1m7Sb9kmSeycO2WxQLGKIP3US4d8TRsDIX0D9tEpzolsfiu6KYY 1/pkyhvanY+vHpb52EI3+5QyrfrJGjXWGbeP1uPVCaKKE9/Ug+Se7fTQamn2koXlKntB e0vw== X-Gm-Message-State: APjAAAVkZSAgj0bfZ1MZm5Wk0eQ3F1FPCMZOnla5MZ9263e2viKin7P8 4tAG8LnW/P77oLQEVGH/i9MhAQ== X-Google-Smtp-Source: APXvYqwcXL9IUcA1NwWjkBG6ihgZ1mTQNQKZY+myfeizvcbcy9RQ9+vXBtLYoNyG3c9FkCNmz89Vqw== X-Received: by 2002:a63:4383:: with SMTP id q125mr13830250pga.373.1570752781928; Thu, 10 Oct 2019 17:13:01 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id v68sm8097683pfv.47.2019.10.10.17.12.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:12:56 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 24/29] powerpc: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 10 Oct 2019 17:06:04 -0700 Message-Id: <20191011000609.29728-25-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_171303_473348_BD4EB695 X-CRM114-Status: GOOD ( 12.12 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Since the EXCEPTION_TABLE is read-only, collapse it into RO_DATA. Signed-off-by: Kees Cook --- arch/powerpc/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index 4e7cec088c8b..8834220036a5 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -7,6 +7,7 @@ #define BSS_FIRST_SECTIONS *(.bss.prominit) #define EMITS_PT_NOTE +#define RO_EXCEPTION_TABLE_ALIGN 0 #include #include @@ -162,7 +163,6 @@ SECTIONS __stop__btb_flush_fixup = .; } #endif - EXCEPTION_TABLE(0) /* * Init sections discarded at runtime From patchwork Fri Oct 11 00:06:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184677 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 BD1A3139A for ; Fri, 11 Oct 2019 00:13:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5620121929 for ; Fri, 11 Oct 2019 00:13:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="crNQYlpS"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="QKMy1WMI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5620121929 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=5KtzDiIAA94ebvgZWkQWwr2KPMax8EyWWAf658FUN6g=; b=crNQYlpSJxdA7AL6unQq3yjn2i mnk4u3Kxbpf8OR1ozjQGfxTxH0hi1YeGnKuVEaqR5wYqAaBQpl9qC07kiyE7c4LZlEILkUE9IGo/W /IK+WYZT3noFlH2XA28eWOt2BDp4fx7bNE+NIZdXYNWJs955eSQvSWW8rXLfLaNbH0lWem4sGIGWU I2uIWB4B4eLjMs+rGnd8Kz9rYqlUYyS6mnSEvbXz6S67hohdaOm0311Ol9HIiGaMHBk0tGoOVEI2K m+aU+91xYzYRBE+OOkVlgJAUTYz+YMTawitFWR3aK7zGezVsPzyH9A+qw7AG8LY/lMRcdbsFWddpi 8YXtEJtg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiYN-0001mo-Gm; Fri, 11 Oct 2019 00:13:07 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiYA-0001XX-9t for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:12:55 +0000 Received: by mail-pg1-x541.google.com with SMTP id t3so4693928pga.8 for ; Thu, 10 Oct 2019 17:12:54 -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=aXC4EKkSKWAzbgJ5UkNW5ASNd77O0uNGfoVDwB8PV7o=; b=QKMy1WMIao8eo2h9Q1TmJ+NvwxmYIJS5BiRFvnKXyWnyHt2NVU1sSJRyaYkSK0bnTI 3g26hGi2M+7oPqpQxxO8mfA0+ckl3W/NOZq89OJYBy8zqpl256YQ/kRKmZl3wcK/Al8o WR97u6SnuI6udJBDDM4eXoslNY2BMQS6h8HHA= 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=aXC4EKkSKWAzbgJ5UkNW5ASNd77O0uNGfoVDwB8PV7o=; b=ZYY7XnTnb2Am7UIbUFEAsf6ogrdrnDUoJ8K52/yESYz6jaKDLK6ooRiu1HNkzPkL0V 20bPLxrQSYKx49RWN3AEobwzcZY0BfbGf6PxCNMbqlCtGs7TR6JcdoS0HYUaPJ9r/0af 84RvzaWoMZ2pEyVcN7bAq2Iwlp2+b/G4D0W4Bb4lPhOwBbkL8ZGjGPy0u0dvhTUFHcS0 iEPvBGl6PJezgCnaMjOTHjUzm/A7JCypTkv0MhdzGJakm6JDvaW7ayzpwnWQGkPAXvjx AiA6/FAGvq/tHvL1SwT1uwI2IjNpPSuHlGzCMl0uMEXRjMLAUjm1paOdGDYcY3xynD0h yBWg== X-Gm-Message-State: APjAAAV5V3BL66A1tAgy/VLrSlmm4q823Bwiz+ZUiZK9xHUiywgOHkp6 uqqRy5uG/qAJGtZAL2GqgFiLig== X-Google-Smtp-Source: APXvYqwyN8mvkbsH6LAVRfjY92v44FJMaCqPYldcWqY2MvbBlNQ7Douul4dniL7y8RNurjH2A60mLg== X-Received: by 2002:a17:90a:1617:: with SMTP id n23mr14581628pja.75.1570752773811; Thu, 10 Oct 2019 17:12:53 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id w10sm5837436pjq.3.2019.10.10.17.12.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:12:52 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 25/29] xtensa: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 10 Oct 2019 17:06:05 -0700 Message-Id: <20191011000609.29728-26-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_171254_343181_D01BA67C X-CRM114-Status: GOOD ( 11.96 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:541 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Since the EXCEPTION_TABLE is read-only, collapse it into RO_DATA. Signed-off-by: Kees Cook Acked-by: Max Filippov --- arch/xtensa/kernel/vmlinux.lds.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S index bdbd7c4056c1..0043d5858f14 100644 --- a/arch/xtensa/kernel/vmlinux.lds.S +++ b/arch/xtensa/kernel/vmlinux.lds.S @@ -14,6 +14,8 @@ * Joe Taylor */ +#define RO_EXCEPTION_TABLE_ALIGN 16 + #include #include #include @@ -130,7 +132,6 @@ SECTIONS .fixup : { *(.fixup) } - EXCEPTION_TABLE(16) /* Data section */ _sdata = .; From patchwork Fri Oct 11 00:06:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184717 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 BC7B81575 for ; Fri, 11 Oct 2019 00:15:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 97BDF21920 for ; Fri, 11 Oct 2019 00:15:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="iQgBfMaV"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="fp0EZsT2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97BDF21920 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=S+bPBlZoW++2qT9FA+YUDQkcYAzczudO58PkRpXBgXg=; b=iQgBfMaVsDABnXPp4S+fMGxGWg MxADxf+sZ4DZzDxd2jf2djBHEus00GFgzOqy4ahoOkd1Osf98WGAwzdmAHezUd/YlfF3608iE/uVR GxiwVW1xpE2gyOP4P+2pBo+brXcsX2mx0KN/DSdltbcMPTHx7Rt+A45do1RycvMKF8Znyc/qpxe4l pVL+0Yxp9hRt3cgxZjMiFzTXGJcTVn2IZs2UaVsDr5sMjuWhbVKFts8M+E4bZ9hnGeXMHy4vWaf4A fE9hpP08KDVZbRusvJQnwujRDsV7Te5CHdK21qWmObPqa1IsZTFhgwDn0AuabOASnEGl1M3Axq2go Jueu/BCg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiaz-0005QF-2v; Fri, 11 Oct 2019 00:15:49 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiYJ-0001iF-Lp for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:13:05 +0000 Received: by mail-pg1-x543.google.com with SMTP id b8so4678483pgm.13 for ; Thu, 10 Oct 2019 17:13:03 -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=8/x+eaVk+ss1aFRFRC2BuuTBFLP58LLEcIBPNJoL2cs=; b=fp0EZsT2tyBJy4pMM0BrQdWNH3jIqPiiR0OFuPR3KKp9NlEmrHQgmL/ZBNM1hxDEVj gMnsWemWjREXcL9c9lek/rM89s9e/l7HiEkBH/KqKwR6byArefKYaaiKWxjJgqllWaPD 6nPt+boxm7/SK9xvW9TYHnHh28YvJaU9w+77g= 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=8/x+eaVk+ss1aFRFRC2BuuTBFLP58LLEcIBPNJoL2cs=; b=U4Eab1F7Kncl8NhQUyVTbVA5aTFDC3hEtoh4fcIXe+I+aWOH1BPeZsdEbLPJu6VLbm J1sd9wGifKp0jtSCR7zB5xUpfpSre7qQDkrbx7i1ZH2M+feWHcHhcNsDkE3uNOihJr61 eAcFZc6FicbvNmx/kbh3ri6EJkzKTUthriu9uvXGvk/qdVMGi8wwODgzUTLMEEnUk8jK NGrfk9FfXpSaLQ4h7M+m/SHwSlkuLZAWJjjIefO9TGHd/Ji/CqS51stCb1bEMWUFK/k1 KjGgiHAY3KDdeLONzrANH/oS4zg+ilWhJ56E0l2WGsTRC7CV3bqWoUKfVVHj8Vx6PWRj /wMQ== X-Gm-Message-State: APjAAAVj2kDRDNtnXuIIBaB7+BWbSrAmBiv80fkVkOHfx3v4Dno76ssx y2cqaYuOXGDAz5OclKIrC6n+TQ== X-Google-Smtp-Source: APXvYqzYV7Ta2O1ssdo06WBxZ2tymf8EVzlYCRiZUZ2NeL/vJyas9bBJT97ICY4x4F39C1qUjsxcog== X-Received: by 2002:a63:2350:: with SMTP id u16mr1550233pgm.103.1570752782606; Thu, 10 Oct 2019 17:13:02 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id q36sm7238812pgb.34.2019.10.10.17.12.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:12:56 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 26/29] x86/mm: Remove redundant &s on addresses Date: Thu, 10 Oct 2019 17:06:06 -0700 Message-Id: <20191011000609.29728-27-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_171304_012672_7097DB9C X-CRM114-Status: GOOD ( 12.18 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:543 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The &s on addresses are redundant. Remove them to match all the other similar functions. Signed-off-by: Kees Cook --- arch/x86/mm/init_64.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 26299e9ce6da..e67ddca8b7a8 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -1300,9 +1300,9 @@ void mark_rodata_ro(void) { unsigned long start = PFN_ALIGN(_text); unsigned long rodata_start = PFN_ALIGN(__start_rodata); - unsigned long end = (unsigned long) &__end_rodata_hpage_align; - unsigned long text_end = PFN_ALIGN(&_etext); - unsigned long rodata_end = PFN_ALIGN(&__end_rodata); + unsigned long end = (unsigned long)__end_rodata_hpage_align; + unsigned long text_end = PFN_ALIGN(_etext); + unsigned long rodata_end = PFN_ALIGN(__end_rodata); unsigned long all_end; printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n", From patchwork Fri Oct 11 00:06:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184713 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 5598D1575 for ; Fri, 11 Oct 2019 00:15:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2B3AF21920 for ; Fri, 11 Oct 2019 00:15:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DxD+zS/A"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Lj7QNKSF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B3AF21920 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ZB9F1UwoKQEjorFvMYTfPcOwUVpYEHYuP7sB+Qs+W/0=; b=DxD+zS/Aw7+YSmRzVwHKhs4pk3 UayWKxP+Ehe/+8jaLOm8ovNjMg4MCYzGb1CtFyMG14cK4auketWVf8So8J1K6ct9aOOsurdrdqJ8a 0WSU29uunuuwMhZA8vVCuG3V1jdY+aLPvM4VE4bJjL/6jdqrv0rbLtF6smjnCGTYN5tYqIy2hDLZf jd0WyZFDVAaqzaKqHYjfa5OKY/qtwgUrVsNh3uxApXad9kw18+EvEam5QhVCwptFFQDfz/sWD2ID4 sp+StqbLZYdJN7hbOEApHBdOKybjuMyFvnSJOzQU1Z5tZF4EPyuYMTc716S148F/EO+iwWMKyCBA2 NrD0Dv4Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiaZ-0004yE-0Z; Fri, 11 Oct 2019 00:15:23 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiYI-0001gr-5N for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:13:03 +0000 Received: by mail-pg1-x541.google.com with SMTP id i76so4712723pgc.0 for ; Thu, 10 Oct 2019 17:13:01 -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=CyoXOdP2RSQBzcYa2ar7sJXCOKRhNFJ5bhxtCWldzm0=; b=Lj7QNKSFAWUpBfpzOt7+g6iG1nZwQWiy2Yx2COX4rHzLDwe7zAeBtuvEmbHCBjMdVS f7OItuAMoBx4ANIxisnsIuIzLX/n/2wSchdTwd5gBy79nJpGqvgOWz8QIjj/yjSDeyUu Nk/yU3k7rraRoC3ReBbUSn8UR29/tNR/sk7J8= 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=CyoXOdP2RSQBzcYa2ar7sJXCOKRhNFJ5bhxtCWldzm0=; b=kLuTtqZ1njAZv2xVhG/2zl0WXNnShNgVnZMzm1WBV1SSK0ZGbuivFQDez8parrR5jG ErXi49TU3wCKXh1utqf4fbx164gPyOSxkiFxbOlm3Lsny5zQCFsDXpsu74xmfPyAQVZl 1gojJMci/D8j1FGz0cFeSj07zuOZquqtEP2NCLpMxjeXeOu8Lg4MyZkJkgd1kz7jbPYk IcUa8PmNWRU3REc6jtLmOBb+3/2sWw2kKPYeFEC0P7QshkkgCzAdq6LRM+RQx6OunanN bxUn9VUFMeOMBOEIkvSByYH1k+B9X6lBF2d8vt5GQUdKJnZDGL/HJR/+7RvO2KyE9z/G si5g== X-Gm-Message-State: APjAAAWAsSkKCfe2kqaz/FPB9aTXKZ307dzJkGKeZVXePq5lUOxI7PRg dNh70BxQ+Xag+FLKX8K5fdZ/Kw== X-Google-Smtp-Source: APXvYqzvlppGYfKVE9ugq/bM5vvDAuSQD7dhWwgiw+2wssyvKHG8+r3B0+BR11AxbHRgVxFlF3OFFg== X-Received: by 2002:aa7:9907:: with SMTP id z7mr13951279pff.192.1570752781298; Thu, 10 Oct 2019 17:13:01 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id t12sm5458788pjq.18.2019.10.10.17.12.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:12:56 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 27/29] x86/mm: Report which part of kernel image is freed Date: Thu, 10 Oct 2019 17:06:07 -0700 Message-Id: <20191011000609.29728-28-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_171302_234172_9AFD10AE X-CRM114-Status: GOOD ( 12.36 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:541 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The memory freeing report wasn't very useful for figuring out which parts of the kernel image were being freed. Add the details for clearer reporting in dmesg. Before: [ 2.150450] Freeing unused kernel image memory: 1348K [ 2.154574] Write protecting the kernel read-only data: 20480k [ 2.157641] Freeing unused kernel image memory: 2040K [ 2.158827] Freeing unused kernel image memory: 172K After: [ 2.329678] Freeing unused kernel image (initmem) memory: 1348K [ 2.331953] Write protecting the kernel read-only data: 20480k [ 2.335361] Freeing unused kernel image (text/rodata gap) memory: 2040K [ 2.336927] Freeing unused kernel image (rodata/data gap) memory: 172K Signed-off-by: Kees Cook --- arch/x86/include/asm/processor.h | 2 +- arch/x86/mm/init.c | 8 ++++---- arch/x86/mm/init_64.c | 6 ++++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 6e0a3b43d027..790f250d39a8 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -958,7 +958,7 @@ static inline uint32_t hypervisor_cpuid_base(const char *sig, uint32_t leaves) extern unsigned long arch_align_stack(unsigned long sp); void free_init_pages(const char *what, unsigned long begin, unsigned long end); -extern void free_kernel_image_pages(void *begin, void *end); +extern void free_kernel_image_pages(const char *what, void *begin, void *end); void default_idle(void); #ifdef CONFIG_XEN diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index fd10d91a6115..e7bb483557c9 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -829,14 +829,13 @@ void free_init_pages(const char *what, unsigned long begin, unsigned long end) * used for the kernel image only. free_init_pages() will do the * right thing for either kind of address. */ -void free_kernel_image_pages(void *begin, void *end) +void free_kernel_image_pages(const char *what, void *begin, void *end) { unsigned long begin_ul = (unsigned long)begin; unsigned long end_ul = (unsigned long)end; unsigned long len_pages = (end_ul - begin_ul) >> PAGE_SHIFT; - - free_init_pages("unused kernel image", begin_ul, end_ul); + free_init_pages(what, begin_ul, end_ul); /* * PTI maps some of the kernel into userspace. For performance, @@ -865,7 +864,8 @@ void __ref free_initmem(void) mem_encrypt_free_decrypted_mem(); - free_kernel_image_pages(&__init_begin, &__init_end); + free_kernel_image_pages("unused kernel image (initmem)", + &__init_begin, &__init_end); } #ifdef CONFIG_BLK_DEV_INITRD diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index e67ddca8b7a8..dcb9bc961b39 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -1334,8 +1334,10 @@ void mark_rodata_ro(void) set_memory_ro(start, (end-start) >> PAGE_SHIFT); #endif - free_kernel_image_pages((void *)text_end, (void *)rodata_start); - free_kernel_image_pages((void *)rodata_end, (void *)_sdata); + free_kernel_image_pages("unused kernel image (text/rodata gap)", + (void *)text_end, (void *)rodata_start); + free_kernel_image_pages("unused kernel image (rodata/data gap)", + (void *)rodata_end, (void *)_sdata); debug_checkwx(); } From patchwork Fri Oct 11 00:06:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184665 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 38374139A for ; Fri, 11 Oct 2019 00:11:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 15ADA214E0 for ; Fri, 11 Oct 2019 00:11:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="acrRD61b"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="V5SSXiOU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15ADA214E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=rTAlLTCYWXdAuI36vCnTPWrl21c1n5566LhbStnbDJ8=; b=acrRD61bh+2No+UqrWIcOwYtrv 670rcy+JtlhNRxGfrBtQc+VWTFfgJtAhQpqTMfIy0xe6909D4zytYxjWKtFrV7KiKWmpfgxPPXet7 S2p5gXjuqgruzcMEOLB6oVqPguStPn5EA1QjE9pdBdGZnx7Q/0I5WaXz3jbkIXMm3btw6WTkJmBxl FWBobhRgwpWk2sUsUAamU2/Nv7y8KljRLb9iJxSTEHDzgqz9w2kgP299VgDs9nkMkdy9uw5Jt2y8E Gy0dR4DCp/EhG32VX2VKHjJHw6Ld9wRCmL3XOpdoqbUV0p1jIhxgoI7oLeDqmawbAxkTf7J5PUz1q ljrTBHZg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiWK-0000Ti-Pr; Fri, 11 Oct 2019 00:11:00 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiS7-0003kn-2K for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:06:40 +0000 Received: by mail-pf1-x444.google.com with SMTP id v4so4946570pff.6 for ; Thu, 10 Oct 2019 17:06:38 -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=ZBHIZP91az7zFwublbVFIxiUPIvhqcpifj2fGv96nM4=; b=V5SSXiOU/2LqW+YWMWv2g8oE+O+8OqaVciMsltfBT6XAT+UmV5TNibrJhEtO410tXb /OnY7p2PJHhLZDVx/eoiV5CS19ovJ8wYT+GUzFT433OArvUWowNhqhNxhPEcl3xsRkLc lb2h6DldDdTdhb4T8VOEQWN9DqKeDub1PenXs= 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=ZBHIZP91az7zFwublbVFIxiUPIvhqcpifj2fGv96nM4=; b=JPrZwzRv6I+f2tqnvTFgCzJi8ldbnnT9NK2sTNhUpQENy3eTxwFxIfiU7XML7pGyRa 8amd3zNEKoN+b0AlbHCYaevHy6gR1QZYjXGaCMUiAMIUZUs+Q7oqPsoQJGZBbgEgzbWH 8YrQjk191plOxR2+FfBLvCGWAdZlR7XclPXM8Qcz+Nuw1yU6vJh1XACrIXf7+fAuc8RP j+TPZyERwOVUGMrCo43cPqJfHF88XFGS4Dc5w23PMb5kQFqyVpT59HRaSLidk1DuP63n uA5hrifcjMJEZxmrzhHy6PpfxKGBpAKwuFGecRPBa2tszXWwfRo9f0tkMn6aDrPZNRAB OMBg== X-Gm-Message-State: APjAAAWOXEyUlUH/sUwmD1UKMueW+gc4peVjI59ifPpmNjh+oQsuLQAF V8w20gSUegFBYCByPeCXOjFgsA== X-Google-Smtp-Source: APXvYqxIURRErEoWhZaXwUViGgbdz47KTCDz+s6x66JTdawkgAKVzwgCcLp2sAcohHOnlA3CSEfhcA== X-Received: by 2002:aa7:9157:: with SMTP id 23mr13458255pfi.73.1570752397032; Thu, 10 Oct 2019 17:06:37 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id n15sm5864975pjt.13.2019.10.10.17.06.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:06:35 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 28/29] x86/mm: Report actual image regions in /proc/iomem Date: Thu, 10 Oct 2019 17:06:08 -0700 Message-Id: <20191011000609.29728-29-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_170639_267983_C9DDF8E9 X-CRM114-Status: GOOD ( 13.07 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The resource reservations in /proc/iomem made for the kernel image did not reflect the gaps between text, rodata, and data. Add the "rodata" resource and update the start/end calculations to match the respective calls to free_kernel_image_pages(). Before (booted with "nokaslr" for easier comparison): 00100000-bffd9fff : System RAM 01000000-01e011d0 : Kernel code 01e011d1-025619bf : Kernel data 02a95000-035fffff : Kernel bss After: 00100000-bffd9fff : System RAM 01000000-01e011d0 : Kernel code 02000000-023d4fff : Kernel rodata 02400000-025619ff : Kernel data 02a95000-035fffff : Kernel bss Signed-off-by: Kees Cook --- arch/x86/kernel/setup.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 77ea96b794bd..591e885a852e 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -143,6 +143,13 @@ struct boot_params boot_params; /* * Machine setup.. */ +static struct resource rodata_resource = { + .name = "Kernel rodata", + .start = 0, + .end = 0, + .flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM +}; + static struct resource data_resource = { .name = "Kernel data", .start = 0, @@ -951,7 +958,9 @@ void __init setup_arch(char **cmdline_p) code_resource.start = __pa_symbol(_text); code_resource.end = __pa_symbol(_etext)-1; - data_resource.start = __pa_symbol(_etext); + rodata_resource.start = __pa_symbol(__start_rodata); + rodata_resource.end = __pa_symbol(__end_rodata)-1; + data_resource.start = __pa_symbol(_sdata); data_resource.end = __pa_symbol(_edata)-1; bss_resource.start = __pa_symbol(__bss_start); bss_resource.end = __pa_symbol(__bss_stop)-1; @@ -1040,6 +1049,7 @@ void __init setup_arch(char **cmdline_p) /* after parse_early_param, so could debug it */ insert_resource(&iomem_resource, &code_resource); + insert_resource(&iomem_resource, &rodata_resource); insert_resource(&iomem_resource, &data_resource); insert_resource(&iomem_resource, &bss_resource); From patchwork Fri Oct 11 00:06:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11184711 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 1E03C14DB for ; Fri, 11 Oct 2019 00:15:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EF2D821920 for ; Fri, 11 Oct 2019 00:15:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="efUvEQEJ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="TKF/H7IX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF2D821920 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=oiRcE1Mi4TeHZi5E8OLwj+ZJCIuFmdRvhtg8K+cMCDw=; b=efUvEQEJCk5z+4/c+7TuFfNXvB HnzQsogQaYkaaaroLaomR/EOIHgSK5+VgkedDzjC9+dNAKkc4bQ7yWVOi+L0BANAVf4YgNDgaYZ/E uvOG1URhcuVU91EVNjwUpShOCKB5LffiG8wCboTrigCwx1cTfq3zAq30puZT8E/k66UJtB6Ugus5Q kuMxjNy7+eJxxXadWbAc/iaBQ+8hg5mv2pHE758lrHWmK9QfGzUNDjM6GaVc9WLGD9AILngfD1Q01 FutV+hDH4R8OOeLa33orhh03KQjFnYg12LlwEPX9SpYH2QVBpRfcTmIAkfWr81wWSIGAVf5mXEHDK LJ5w1jhQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiaF-0003Yc-O7; Fri, 11 Oct 2019 00:15:03 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIiYH-0001fr-DU for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2019 00:13:03 +0000 Received: by mail-pf1-x444.google.com with SMTP id v4so4954741pff.6 for ; Thu, 10 Oct 2019 17:13:01 -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=Wn91QvvOWXGcdAukdBFPOsAS+V9wjbJFfxE/dszqFsM=; b=TKF/H7IXE7UJDzb3rMUleub9owN4KR+Kc5MridCe/6j0nlzZqoEI/zttKy0QHihDrJ 2ZeHmtUNHexo6bQLRtT0gDvTipRD0K5TGW8Q7FVWpvhcmLBUGnPT1TySO+nYDUITKTZu 3WNoDW0bVMFt0uCMT6eBCSnH00RkY54ViUTLk= 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=Wn91QvvOWXGcdAukdBFPOsAS+V9wjbJFfxE/dszqFsM=; b=RWMRqRh+iBUyGG8UvaeV2l5A/f7hkAUQSKx7XYAxVaIGryjCKA+K4s1y6kIEgQmuqL xu9BL0t6hMFIjk92bLDGqBH8hhuhF/K0/jXC7O3C/knkKJtqw7tK7YWQt9t0sULXKEZ1 pDL02uUemLl6aHA9E2sNycs1D9HP88Zu3fqW6dssFHeQsy10r4I0yWfXEpHSEnJu5YXk 309h1gjMfHqEXzh8HKCfuT3HK1sft9hq9+Ck0v3QgvmNM6tN4mQU0XS6IaaXpgtZNHe1 QU4UOcKKS6+dZcmUtEqX5S3NmYGOpwQ4w1GgR5wWj8eX4I7VFFeQ5JuhY4//aGOsR0gC XX+Q== X-Gm-Message-State: APjAAAUSttnvyNY0+wodnJfnal3W5vHxqjhvCMvjjlL6wXfh1TaRjNXq 3ZarziXmuNRRG6S4QG9z1hX/xQ== X-Google-Smtp-Source: APXvYqwhzx8QmNWMryCruzS69inQpCD817u3s0gzfMeJwk1Bb2iOQgca7Hto534MUkNuyGvUJAkyfA== X-Received: by 2002:a17:90a:ff0f:: with SMTP id ce15mr14913883pjb.14.1570752780484; Thu, 10 Oct 2019 17:13:00 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id y144sm7993803pfb.188.2019.10.10.17.12.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:12:56 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v2 29/29] x86: Use INT3 instead of NOP for linker fill bytes Date: Thu, 10 Oct 2019 17:06:09 -0700 Message-Id: <20191011000609.29728-30-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_171301_458517_E02D654E X-CRM114-Status: GOOD ( 13.98 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , x86@kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Michael Ellerman , Dave Hansen , Heiko Carstens , linuxppc-dev@lists.ozlabs.org, Yoshinori Sato , linux-parisc@vger.kernel.org, Andy Lutomirski , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Instead of using 0x90 (NOP) to fill bytes between functions, which makes it easier to sloppily target functions in function pointer overwrite attacks, fill with 0xCC (INT3) to force a trap. Also drop the space between "=" and the value to better match the binutils documentation https://sourceware.org/binutils/docs/ld/Output-Section-Fill.html#Output-Section-Fill Example "objdump -d" before: ... ffffffff810001e0 : ffffffff810001e0: 48 8b 25 e1 b1 51 01 mov 0x151b1e1(%rip),%rsp # ffffffff8251b3c8 ffffffff810001e7: e9 d5 fe ff ff jmpq ffffffff810000c1 ffffffff810001ec: 90 nop ffffffff810001ed: 90 nop ffffffff810001ee: 90 nop ffffffff810001ef: 90 nop ffffffff810001f0 <__startup_64>: ... After: ... ffffffff810001e0 : ffffffff810001e0: 48 8b 25 41 79 53 01 mov 0x1537941(%rip),%rsp # ffffffff82537b28 ffffffff810001e7: e9 d5 fe ff ff jmpq ffffffff810000c1 ffffffff810001ec: cc int3 ffffffff810001ed: cc int3 ffffffff810001ee: cc int3 ffffffff810001ef: cc int3 ffffffff810001f0 <__startup_64>: ... Signed-off-by: Kees Cook --- arch/x86/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index b06d6e1188de..3a1a819da137 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -144,7 +144,7 @@ SECTIONS *(.text.__x86.indirect_thunk) __indirect_thunk_end = .; #endif - } :text = 0x9090 + } :text =0xcccc /* End of text section, which should occupy whole number of pages */ _etext = .;