From patchwork Thu Sep 26 17:55:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 1168058 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fNMy4dDCz9sNf for ; Fri, 27 Sep 2019 04:13:34 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="DCGoaVd1"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fNMy3b9tzDqfk for ; Fri, 27 Sep 2019 04:13:34 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::541; helo=mail-pg1-x541.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="DCGoaVd1"; dkim-atps=neutral Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN091xq5zDqnx for ; Fri, 27 Sep 2019 03:56:21 +1000 (AEST) Received: by mail-pg1-x541.google.com with SMTP id w10so1954799pgj.7 for ; Thu, 26 Sep 2019 10:56:21 -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=DCGoaVd19CahdKM67vauwYq6A0n5O1bU2fwJSQI6+6L/QL8IWduHMpbD2D082JUMYu tdZce3zeDL64zrWCWjE/SDwatGi3I36cLWh3ChbpkxGYUJmrkhZ3GZpcYkkrQcTuN6Kz BMWhWC28K9ifpqbHkwnwms2pPbRZQRavPSH8w= 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=DX1FFTjxlNb8Vc5i7miSA9i0niKe4/Q9cJdMEH8hu3BSbM3dmm9zWtqIWsC1G52+Cm utdfWHr3NGJug3urhGQvPyx/Om+CQvQiSWRFN25QKgJonMh4LLO9nMErzUIxlFIxZ/PL nrbzmuDZQet0n9s+Fx7wjKv7JmTWBkB7TibhKqL3SL4dbQtC3A2t3JxhxsG5ukGTJDCV uDJTYQ4fPN/FLFgQYNSx1OkG7S0E/r7H06ReiYGKA0m7oHetYbjeCsEYaJq+K8jgsRk0 e2wY5XFipe+ejg3DoOtqZp122rUXu5Xu7uzaoHxXMwA0TXQMzw2IOaB1iDziOLKMzlMw nl5w== X-Gm-Message-State: APjAAAXciL433CwpPoSyIA019CgpKwlXoc/nblpPAGyFbSXBRup9gzw7 T2KAc/9bTyn9f4NGlAlA1f3tEQ== X-Google-Smtp-Source: APXvYqx+Nc4F3BFxu5gBtlblqAA7dVzSt2eXx8oUumqPJNhjfOYoqU7jhFXju/6qtRKJS06j3p5MdA== X-Received: by 2002:aa7:8bcc:: with SMTP id s12mr5094703pfd.93.1569520579420; Thu, 26 Sep 2019 10:56:19 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id v12sm2855407pgr.31.2019.09.26.10.56.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:17 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 01/29] powerpc: Rename "notes" PT_NOTE to "note" Date: Thu, 26 Sep 2019 10:55:34 -0700 Message-Id: <20190926175602.33098-2-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 --- 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 Thu Sep 26 17:55:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 1168034 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fN7W5jp6z9sNf for ; Fri, 27 Sep 2019 04:02:47 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="cgLBIK2I"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fN7W4cL9zDqt0 for ; Fri, 27 Sep 2019 04:02:47 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::441; helo=mail-pf1-x441.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="cgLBIK2I"; dkim-atps=neutral Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN091vq3zDql5 for ; Fri, 27 Sep 2019 03:56:21 +1000 (AEST) Received: by mail-pf1-x441.google.com with SMTP id q7so2246187pfh.8 for ; Thu, 26 Sep 2019 10:56:21 -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=RJAKRXgj/kaRPgvukPvg+1dwSCdKJa1mCaEQYaeOHdg=; b=cgLBIK2I68VieSmLoKuVJtCF3SylTocfsX1gD0Zs19cToPMkoDiwNmt929x1jNUOgM aS469WaQkJpluXBWk8krsQRT5IpbWVxb+hJFQczm9Jyie4qjp5mT/a44DKLoq641n34N GcYWI51/QHsLK6gyjooxRPZO/pVEfarMYPph0= 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=RJAKRXgj/kaRPgvukPvg+1dwSCdKJa1mCaEQYaeOHdg=; b=eTQx09TGsuQHLahxkmCUPT4uVhMErOrUENn7dPsQuZj4My2fveh7FUZXSMO2kasBzn Y+9DZRfRIOYyG/RzETNlDzEA9brGBYqWYykHEW6df85XBD4+CiGtTZyjzH2BaG0iOmvZ 8G/TTbQFqDGUhT9+DzzgpUc3EseXjIRMwi4kZRdeh5avVGV8PPbPU3qy4zHP9inwLFCw JNh1BVYnKbt3Mk8QRp+J0HVcjCkiPbQQDe+8QTN0X3JZHeB93Oy8lEsA/iTP5TbGs/R0 F89BYtie2KxRRcXAZ9rQGqqKIrc/3akxTa9kftSZKGrfkmh4FNUryvF1xMe27xsUz2Cz 1uiw== X-Gm-Message-State: APjAAAUrIY8Poi5lbEcJ3aHx8ITNANbT88QplJNAYcQBNysM/jn40OUf yMLOAJdUHlYx2uZwjh25jRrbsg== X-Google-Smtp-Source: APXvYqw9bqVEzqvhNYWWHWCOecHFyvs7kCSvbBABX1UJtGaZhRU8CZacQlRri1ZquDN9vFG1tzvxgA== X-Received: by 2002:a62:d406:: with SMTP id a6mr5185002pfh.213.1569520577934; Thu, 26 Sep 2019 10:56:17 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id c8sm3054165pfi.117.2019.09.26.10.56.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:16 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 02/29] powerpc: Remove PT_NOTE workaround Date: Thu, 26 Sep 2019 10:55:35 -0700 Message-Id: <20190926175602.33098-3-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The kernel requires gcc 4.6 now, so this PT_NOTE workaround can be removed in preparation for moving NOTES into RO_DATA. Signed-off-by: Kees Cook --- 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 Thu Sep 26 17:55:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 1168039 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fNH82WB9z9sNf for ; Fri, 27 Sep 2019 04:09:24 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="CqN1lXbz"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fNH81GgZzDqtl for ; Fri, 27 Sep 2019 04:09:24 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::444; helo=mail-pf1-x444.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="CqN1lXbz"; dkim-atps=neutral Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN091t9KzDqkc for ; Fri, 27 Sep 2019 03:56:21 +1000 (AEST) Received: by mail-pf1-x444.google.com with SMTP id b128so2280306pfa.1 for ; Thu, 26 Sep 2019 10:56:21 -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=twBnW9003cRUVrvl7rna64y+l4pXeTWwCidRvKd4upQ=; b=CqN1lXbzhTBvyldWDeFFG0HQSt646TlwSvqceNpapyoRiUWQ5YqqN4cPwhtdyRn8hE PVXIyXkZUO4laSWWNvkw5iINx8LA8erBgYyntG+Tsm/SabZpT1rGUewt5++Krmp2ifoS gGD+zS0suOHck11+UV+BUipLiBtMBQgjj951s= 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=twBnW9003cRUVrvl7rna64y+l4pXeTWwCidRvKd4upQ=; b=ezzVyR7mCXRHpC5qAYT3hGngUPGTRpoF5zmIKQG/iqH+6Pb1Lz3rmSIReFBxNBb/c7 a+VetEP2gkNO1zcTRJYlwaf0KQmkwb7U58YEiQ4tMpXNDiP8wCRTeEmFAMgKJTNZtilw WUOtN65HAOBSI2OcHD1kQVAqt+oKUHk0bVp1PPPUjfz+wGPL5d43badsxDEANmRwby2G SbNartf3+6vznNo5g5p3NqZobrw12On0lk1f0LY0Z3mJw+SXKTplXl0DtlRkWrJ3Tm7Q wmQx7Fev4qpLopdAcNFQWNb1qYHE1kbU4kxg+EcIRUUagzxlYCqcNtfVmIpAuSzOmGc5 DpKg== X-Gm-Message-State: APjAAAWO8vzS7i26jzME37CE+blKMx8slXGzuqU3SIX8ApPH7Z7T0d24 NqyZ0LXx4fGTTVIs3u0fDelwGA== X-Google-Smtp-Source: APXvYqz5sqYBOjfwv1yAIr8+Vv2yIfMOshUTCRUhztJ4ypNIaY8nP1T7DvlPeRwIyHth9hoCfN4Y8A== X-Received: by 2002:a63:cf4e:: with SMTP id b14mr4713210pgj.109.1569520578734; Thu, 26 Sep 2019 10:56:18 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id k184sm5172900pge.57.2019.09.26.10.56.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:17 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 03/29] powerpc: Rename PT_LOAD identifier "kernel" to "text" Date: Thu, 26 Sep 2019 10:55:36 -0700 Message-Id: <20190926175602.33098-4-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" In preparation for moving NOTES into RO_DATA, this renames 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/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 Thu Sep 26 17:55:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 1168037 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fN9y39f5z9sNf for ; Fri, 27 Sep 2019 04:04:54 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="KfnDRarT"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fN9y22zbzDqmJ for ; Fri, 27 Sep 2019 04:04:54 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::644; helo=mail-pl1-x644.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="KfnDRarT"; dkim-atps=neutral Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN093LyGzDqqD for ; Fri, 27 Sep 2019 03:56:22 +1000 (AEST) Received: by mail-pl1-x644.google.com with SMTP id d22so1616067pll.7 for ; Thu, 26 Sep 2019 10:56: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=tfsXsrL5x37ZSQucWl8Bh6EyFQTE0kRi9peGDqUDYWM=; b=KfnDRarTGgWf60O4C9cF+YzTjYXp+pSkpdzWR7YKNXHXP7TAfTSHAkqA4UoYNAcWUP NDUbjKE6AWe2+D+wOTvvlqXbdNAJZsnyYEgw38E2fXR/V8EEz3Xj/vyRfzrhH+es6//f V34BpcFgVde9WGbqi6+RYmyV1MCa8QFUww3V8= 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=tfsXsrL5x37ZSQucWl8Bh6EyFQTE0kRi9peGDqUDYWM=; b=exWzAL3xEjArzL25u+x8ttXq+8jaHC8mHEnNTDIW1UfUuXahA+gPnDN+nZZVEhH5sJ eee1SkVLJrrPdYKTfKZLDolEGZSc7/F+ka/u6sI1iXRaN0xHycNnt/Cf4nYdIxll7I0O 8dZgckXpomkm2Vg31zK/EnqFmbImyP1exoh8wLe4h9o/gjqS/+JEoKX2jeunuURgPSsJ VqF3cCVfDIJxiDvJP/ZR8Zc1MSh+CnBF9w6nEduvC1Xo4yuCj4UYN9PY3W46vdrZFj5p DyBreEPZSiXi1yDO/DXcr4hk79QxQ7smGY+1LRARMAUPVptgvStSdzLU9mGiOyVy8Agr wYEA== X-Gm-Message-State: APjAAAVFDc8Hj0OZObVHC4ydgXDQYRa+71JTbGQQIj+VgIlEKaU6OXMp 0l2UGgnBMmT9heLYnpzIO5AEqw== X-Google-Smtp-Source: APXvYqxNefsDmg9i8vv1ozpPK1xitEq/TEjXZ0cxntHJv7Z/K7QxcGEiK4QwS+/LuR6Pbs4fqhuAog== X-Received: by 2002:a17:902:9a92:: with SMTP id w18mr5189269plp.201.1569520580043; Thu, 26 Sep 2019 10:56:20 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id f15sm2984785pfd.141.2019.09.26.10.56.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:17 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 04/29] alpha: Rename PT_LOAD identifier "kernel" to "text" Date: Thu, 26 Sep 2019 10:55:37 -0700 Message-Id: <20190926175602.33098-5-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" In preparation for moving NOTES into RO_DATA, this renames 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 Thu Sep 26 17:55:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 1168061 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fNTN6z23z9sP3 for ; Fri, 27 Sep 2019 04:18:16 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="h2sveAYX"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fNTN5mFSzDqvD for ; Fri, 27 Sep 2019 04:18:16 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::442; helo=mail-pf1-x442.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="h2sveAYX"; dkim-atps=neutral Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN0C4nFTzDqkc for ; Fri, 27 Sep 2019 03:56:27 +1000 (AEST) Received: by mail-pf1-x442.google.com with SMTP id q12so2245197pff.9 for ; Thu, 26 Sep 2019 10:56: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=VC2Bmzao7X0NkgB6osdHVMHoKcEQeokPuBQAULnAMEE=; b=h2sveAYX3uA/1NDTnSYWWuXYSvlUdaG9aZQBAwdGYVfIjBluySKMZUfy4JB27+8iWL C5EhSq87+nJcT0+Ca5wU/iDaeZ8WX6J4clDqF0ZuuVgUhEVA94tdvnWHwFA9bIVlx1cM a7693de5zHrwGE51wsBB+Q6I0Q3aQ5nxWanDE= 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=VC2Bmzao7X0NkgB6osdHVMHoKcEQeokPuBQAULnAMEE=; b=ixaye4OpMoR7VeXnuwfaMu0BUpGJuo/6RcQsFUB85lNQ+hDIRlP9Q7iIXhpyqRLCzW Cqf/PpZH1eCzEgiOghvmag9qEArdL4sGdbPZIwS78A/f74Hir87BCg0HbLW+H1LtJb/a yv8sIi+AFEJfFAF/+qdAM4Ua5thG1BC2+kSsZTv75j3IrbuXkNI+q5B10QkP4hDCw0IM 3w34CUz7qRilG0iT0mp/gyYHx/m5TNuCITkRNefvO9gGYyyTeT0cba441X3hzaCA5aew GaCDklBkrjxIHjbcJXB2LHLTAZXzrvhjSwgmcFOsid0ddIVx6XmHnIBxWMglDreNPfNi rehg== X-Gm-Message-State: APjAAAVYgJ/HwOwnrOFuc5BLUaRQUEXuYWJYystIRFXQGa3QSK5NbQ8/ +9R406Tw7I2Nce4xr88fjenLJA== X-Google-Smtp-Source: APXvYqx3URWQo+sO/EQWcmMSlPHXmNqT24byGxyOnAx9g17jDBjE8+LmBjBEIagBFZrOvidoBf5ZYw== X-Received: by 2002:a63:5005:: with SMTP id e5mr4869136pgb.442.1569520585037; Thu, 26 Sep 2019 10:56:25 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z3sm5610456pjd.25.2019.09.26.10.56.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:21 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 05/29] ia64: Rename PT_LOAD identifier "code" to "text" Date: Thu, 26 Sep 2019 10:55:38 -0700 Message-Id: <20190926175602.33098-6-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" In preparation for moving NOTES into RO_DATA, this renames 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 0da58cf8e213..c1067992fcd1 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 @@ -224,7 +224,7 @@ SECTIONS { _end = .; code : { - } :code + } :text STABS_DEBUG DWARF_DEBUG From patchwork Thu Sep 26 17:55:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 1168042 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fNKR5Jc2z9sNk for ; Fri, 27 Sep 2019 04:11:23 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="NeoCDK86"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fNKR4GvczDqfk for ; Fri, 27 Sep 2019 04:11:23 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::543; helo=mail-pg1-x543.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="NeoCDK86"; dkim-atps=neutral Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN095wghzDqqW for ; Fri, 27 Sep 2019 03:56:25 +1000 (AEST) Received: by mail-pg1-x543.google.com with SMTP id i30so1989011pgl.0 for ; Thu, 26 Sep 2019 10:56:25 -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=ct25FYY49pcH025DailB6pbS1DlS4bIVNf04cXZx2wM=; b=NeoCDK86mT/W24oE5rtmJouGfsbTTEGkoSxTx4KF4CSxjsSlvFZN3J9odBOQnvlXiP iUyNYZOgnvxnrzhYkrDgkrU0+SzkX/L29uWuoGEThELn/fWhiKJEA65hwXsy3koRBZjm 4+HnR9f+RjX0Rbvz5f8d8QfWgEFoMfVNcSBHQ= 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=ct25FYY49pcH025DailB6pbS1DlS4bIVNf04cXZx2wM=; b=caW4/hkb3ELEEypFjf3s1ZHwsd16gopNM7HNZczYKEKnTr7nSIEtq5xUM7SoURTJI4 nkhwYDepYfs78fiqBL1BEpI7HobtLJZVtuFfM0hdOKlCH56wUZ3Icnfv+80I9UtOMGne CQqQ+VQsNOY8gca9acKxy6xzsqgKu+NXNnkND6PIOM3FaD8lH2o4CCVpItAxhq35ZkEw DLmw/KNCYPV012Z8ohUGu86Mc5siJEEXZloL4ZCYCkHCTJ3E2D5wAFntoqAk0PiuKp3U Uo+XsQ1M2dGGRMg93KiavhHPjul/rRBrcSK7tde/WZqWUGIYiK1/0QAdnyfFMO35RiY2 O+6A== X-Gm-Message-State: APjAAAW5i4vW+fO2YHkcwgyREz+56W0xu3gKk01dtgc6VvKRKS7H2Lcv 8QOiMx9m4FriA2Hjwj7Y6EycIg== X-Google-Smtp-Source: APXvYqwCE1BZTT9Hh90UUQnKWrAcK2jHTYm7yifQDk8oKb7icUZpadcMBDqMvGH5nif/lmL5cmzvdg== X-Received: by 2002:a63:186:: with SMTP id 128mr4612810pgb.157.1569520583020; Thu, 26 Sep 2019 10:56:23 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id e10sm4090474pfh.77.2019.09.26.10.56.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:21 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 06/29] s390: Move RO_DATA into "text" PT_LOAD Program Header Date: Thu, 26 Sep 2019 10:55:39 -0700 Message-Id: <20190926175602.33098-7-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" In preparation for moving NOTES into RO_DATA, this moves 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 --- 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 Thu Sep 26 17:55:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 1168059 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fNQf6zmqz9sPK for ; Fri, 27 Sep 2019 04:15:54 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="bQqqzNyN"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fNQd5C30zDqfr for ; Fri, 27 Sep 2019 04:15:53 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::543; helo=mail-pg1-x543.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="bQqqzNyN"; dkim-atps=neutral Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN0B1XVpzDqrq for ; Fri, 27 Sep 2019 03:56:26 +1000 (AEST) Received: by mail-pg1-x543.google.com with SMTP id w10so1954913pgj.7 for ; Thu, 26 Sep 2019 10:56:25 -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=BEIxyBF1HkRa8rBbPvqIJ09n3nmPR/y1tjhfe0NMzTo=; b=bQqqzNyNY7DBO4nvgPSIP04+h5CJyVsKfEvjzJfmS/V4+ODZb0mTUfyJbfgKxlH+Zf EcxsjmRdikQWm28aLyIpEcu2zYGeo3BNR4PnBQVxsPQueeDIHFJzMBwlKseyYdE8oNqC 7R3DrfnnX5WNs3WMSqS/eB2/JT0kHs051Pfd4= 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=BEIxyBF1HkRa8rBbPvqIJ09n3nmPR/y1tjhfe0NMzTo=; b=hUZtn758VLDkL6MrJV0IXTNJVphE2Vc4BeMsvmFgL2s1IMQ0e7rULC8B+VlDykvYNh 0/z7WoNkNE9Evt/ZMwKrrvXtkzAlf+z8HUgej30KoQXBKSnV57C4mhOyFtpcXqrhGsim i/qVtf12oarRvrmLTw+4+/lNQpqPqk9S5PTjTO6ecC3K+tD1pEfy/xSj0aTFbGQK708z 1I9J/NBhrpqEBJn8OVDaMdC4GbpW7NLGcnBqET7ZzTqaTzq6d+Sl0IdvVbS/Y0MHV/2s aAMj6gDmaa6gXvWqpikbwMdZGJF2RZBFxl1g4lumj2TBeOmScSXltIwiCzVDzcETggVF //lg== X-Gm-Message-State: APjAAAXCbLTDqdLNPeDHe/KVE0ReEQbc4v8aI/zykbdKC3JodEiY4bQy mFvlKivOIbXg1FNsSmPFArYryg== X-Google-Smtp-Source: APXvYqyF69hVmYXL8iit7KpAdlylDNRysPjFRUoiDKvaG1bVd3Zxp6WjhsfeNoA0ipdH698250+hQw== X-Received: by 2002:a62:c102:: with SMTP id i2mr5308106pfg.7.1569520584303; Thu, 26 Sep 2019 10:56:24 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id h6sm3791790pfg.123.2019.09.26.10.56.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:21 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 07/29] x86: Restore "text" Program Header with dummy section Date: Thu, 26 Sep 2019 10:55:40 -0700 Message-Id: <20190926175602.33098-8-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Instead of depending on markings in the section following NOTES to restore the associated Program Header, use a dummy section, as done in other architectures. This is preparation for moving NOTES into the RO_DATA macro. 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 Thu Sep 26 17:55: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: 1168063 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fNZN5vkGz9sP3 for ; Fri, 27 Sep 2019 04:22:36 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="BB+Wp2c6"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fNZN3y1LzDqvw for ; Fri, 27 Sep 2019 04:22:36 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::544; helo=mail-pg1-x544.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="BB+Wp2c6"; dkim-atps=neutral Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN0D4160zDql5 for ; Fri, 27 Sep 2019 03:56:28 +1000 (AEST) Received: by mail-pg1-x544.google.com with SMTP id s1so1953355pgv.8 for ; Thu, 26 Sep 2019 10:56: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=N0Ly0RoWNzS0e9pealT2AjXWyAS0JHK0C0PsWn5tREE=; b=BB+Wp2c62cK4be/dVurtn2OePQOvo8kO+/cwllKtmj/lBxl1iCi9+x2FEqqPcAfu3H 5Jc3fOQT/WyzeOU1pOIuHyA+VT5vFLuQB6+QiCHBNurWJ+z4FXVlveHVrhV2+Pr+hwJX gZ7GbSmn29rI339LO1+fygFnZRmfnLy7trUyw= 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=N0Ly0RoWNzS0e9pealT2AjXWyAS0JHK0C0PsWn5tREE=; b=Sw/5p0WmjcfRMuKXnXkMWW4joKd9WIKBJWm+MoIbjavuuBVlKl28RpBLG8KBBh+xYx jXmzRTD0l/P0t8RCeRAVkB/RkqtEKEcIccmxC4JxuZQRVhWv54TcD4ycnc7KoQyzr2A3 vfM2o+DdFxTd8lj4r9+YaTslw5u89kAecbhdmJwl33HQl/suKnzB1+7DjVVlvZk9BJa/ /4u43LX+w9fqkXHiTFgptcTSkRBsaTx8sY0TIhaQkT3yERd1wHo6WcKirz8/Hr+9Ovom b/vt++uWXlQp88ovSNBMT+5yfifs3f2YzcPRpLipkm3uFDYkzLPnAkFL7ozFEpNhWoir iSwQ== X-Gm-Message-State: APjAAAVUlg0ANxBy/FPeVwqU+B2yBjGLT8P5I9R+1c0ZEEKF+sJXqSlX Gp6JCmcPUkRvBBuQ5TPekPkruQ== X-Google-Smtp-Source: APXvYqz+7EO2SDY0fOuWK5JlMtTN7+23UyO2mdFrzXpQW5FVGpWlsVRMn6xa/+DO76Xw8kfOXh9ozw== X-Received: by 2002:a17:90a:2a4a:: with SMTP id d10mr4960722pjg.72.1569520586396; Thu, 26 Sep 2019 10:56:26 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l7sm8860071pga.92.2019.09.26.10.56.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:21 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 08/29] vmlinux.lds.h: Provide EMIT_PT_NOTE to indicate export of .notes Date: Thu, 26 Sep 2019 10:55:41 -0700 Message-Id: <20190926175602.33098-9-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" In preparation for moving NOTES into RO_DATA, this provides 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 c1067992fcd1..e034a6a4a444 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 cd28f63bfbc7..2cc3ff9ac8c7 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 Thu Sep 26 17:55: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: 1168062 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fNWx63NSz9sNw for ; Fri, 27 Sep 2019 04:20:29 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="cOjv9Lo+"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fNWw1M8PzDqgl for ; Fri, 27 Sep 2019 04:20:28 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::544; helo=mail-pg1-x544.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="cOjv9Lo+"; dkim-atps=neutral Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN0D3KYRzDqkc for ; Fri, 27 Sep 2019 03:56:28 +1000 (AEST) Received: by mail-pg1-x544.google.com with SMTP id i14so1935120pgt.11 for ; Thu, 26 Sep 2019 10:56: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=K0CEaBZVMosV97TjoIjF+mcwc4HOALK07zDqwe2mDqI=; b=cOjv9Lo+vz39Kwj3tNQ1hZIX7qRX5TunV9AMlzhmgRNO3OLsvmYaUFZwfI5s/SJwQa I+DskMJ10/0uMwX1MQnoM5maR+Y4cLrQRjxFLWMaPwikUQGP0Ek401l21Ew0JMzxiHPz UjHA+X4IEv6MK/WxYDP06EebXdp17TVpabeaU= 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=K0CEaBZVMosV97TjoIjF+mcwc4HOALK07zDqwe2mDqI=; b=jkdwDPC0zfG98rYDetFl9EkCabS2SGIxXSD8uTKg0PXUQ/AIhKlbjegcW85hJJgDHS gFZgwJXS+1L7Vo+WQx6SlIf/xdcHFoqr8a7LTWrL0F4v4DQdORz7po1zhsG56p5NOYXS N7Bnbiw/ZKBhCD2161iyxx5w9ch2mUklnAnN/+8IXay/s84LcVbnDhpBG4BNGb2/Hd4O Dnphqx6+1xIrtq1aIDt9VPdWzH9dzeow7F6V/2Ioc/FtBpF7rHs0MBu1Me8YFDnJSAXH Vvu+U0IDgrpTzffwdoNniNOg5PSQT+EUl51NVeR7pEkQoYCnCaQoTkiJs29siXbNGWy5 PQpA== X-Gm-Message-State: APjAAAUz731xZs0P95HqAPVd4NLTithIKNi8Mrk3/1Z7joiBSx0U1pUZ YFk9lEhY9OJLMJqD+NJJ/YbNgA== X-Google-Smtp-Source: APXvYqw9tlSx7V2cBgpwrKr/ncIUrkORrRwucq8unB98gF58bCh7UQXC9abm6opm6rQlU2K4isyVEw== X-Received: by 2002:a63:ea07:: with SMTP id c7mr4890360pgi.106.1569520585671; Thu, 26 Sep 2019 10:56:25 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id d24sm5032847pfn.86.2019.09.26.10.56.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:21 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 09/29] vmlinux.lds.h: Move Program Header restoration into NOTES macro Date: Thu, 26 Sep 2019 10:55:42 -0700 Message-Id: <20190926175602.33098-10-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" In preparation for moving NOTES into RO_DATA, the Program Header assignment restoration needs to 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 e034a6a4a444..fdcc992ab360 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 2cc3ff9ac8c7..6a0a657dfdb4 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. */ @@ -792,7 +800,8 @@ __start_notes = .; \ KEEP(*(.note.*)) \ __stop_notes = .; \ - } + } NOTES_HEADERS \ + NOTES_HEADERS_RESTORE #define INIT_SETUP(initsetup_align) \ . = ALIGN(initsetup_align); \ From patchwork Thu Sep 26 17:55: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: 1168038 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fNF11nz4z9sNf for ; Fri, 27 Sep 2019 04:07:33 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="n9yc4BHE"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fNF10ZtQzDqMr for ; Fri, 27 Sep 2019 04:07:33 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::441; helo=mail-pf1-x441.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="n9yc4BHE"; dkim-atps=neutral Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN096YKRzDqrj for ; Fri, 27 Sep 2019 03:56:25 +1000 (AEST) Received: by mail-pf1-x441.google.com with SMTP id a2so2240301pfo.10 for ; Thu, 26 Sep 2019 10:56:25 -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=O3QCNK0Sa729dKyV+OU4JCI6A47TrPf1EYjHeURUF3c=; b=n9yc4BHEtaq9x6B5Caek1vzC7Kj3cBAKN1aFv5AxrtAqhGoXrV6YdYIMxu2rFMVkPg k9nvejXtTidhjDe1qOVaAEpDCmdnEEqenwqRMZy/FHknIybfHqsmUzoxgFcuVfJyQFxE 0V7i3wSHnbtKbIRqxJtQ1JLFksmfgInqEY2MA= 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=O3QCNK0Sa729dKyV+OU4JCI6A47TrPf1EYjHeURUF3c=; b=ToKCNfeFfOmOY0k0n81aber6+SFFdwzpVbmxGKo0KOjJ3bYltMWe9c2G+gexj5r69r YiCFHuxFpyIXqlA6QH5b8wZCcCfYYCrVXDQ3mVdlBiO4TE1EU4twIJD5nbTl+t60Hu1J 0oFmanA0S2iLxXse3cJhtakmSeddJ5cjFXS+bBrgCET8rPKwRsz15JrzObwelGJT0jnX oE5yEGlla73mbnGjg+YnZaWQlhjI8+0HDcWoJwSGjQxdz0vEU6VJoCCClcFbqm/aZ5Mm 4iCdm63xNyj6K7k+ASAkJzpeffpOfmgZAFgabafobZo7lMB9tN8FZgAe58KO+JTvIbl1 mzUw== X-Gm-Message-State: APjAAAWHC5UqpEOtKJGyWDExRN0Ff+4VHlpNjr1b/FfCfSynfI6dmFwP 62HUs/l/naDmYiCGtdEjv7rZXw== X-Google-Smtp-Source: APXvYqxmYPXz4BvV1iqJiFFDAZheIjk4wIrN+AAlsUUcP9FgR6X3pebswh+pd9KfAuIc5VZHSe/Cvw== X-Received: by 2002:aa7:8c19:: with SMTP id c25mr4982222pfd.150.1569520583539; Thu, 26 Sep 2019 10:56:23 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z29sm4938159pff.23.2019.09.26.10.56.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:21 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 10/29] vmlinux.lds.h: Move NOTES into RO_DATA Date: Thu, 26 Sep 2019 10:55:43 -0700 Message-Id: <20190926175602.33098-11-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The .notes section should be non-executable read-only data. As such, it can live in 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: 1168112 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fPQW4PYpz9sN1 for ; Fri, 27 Sep 2019 05:00:51 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="gU8LOxxB"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fPQW0npqzDqWY for ; Fri, 27 Sep 2019 05:00:51 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::543; helo=mail-pg1-x543.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="gU8LOxxB"; dkim-atps=neutral Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fNBc5y73zDqbY for ; Fri, 27 Sep 2019 04:05:28 +1000 (AEST) Received: by mail-pg1-x543.google.com with SMTP id v27so1953324pgk.10 for ; Thu, 26 Sep 2019 11:05: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=kVlu3UytET+u7KQ09fcnqnLvPl+cN9h82jlVZJfZjTo=; b=gU8LOxxBAqu4ZMjhqcg6B9uvdO+JQKFvVezAsT+/Z7xLV5dDBIvhPco78+OYSHATWV 5vKgvlD1/TWtGQnwfCk7wZ0RsQP6sq6fpYz7/tPJNPScWJo/6tHPyc/NVqe/1uVViJiu QG4qyMvzq9mF+nTaLfsPuABbMBGU0f1v5ZdH4= 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=kVlu3UytET+u7KQ09fcnqnLvPl+cN9h82jlVZJfZjTo=; b=MNk/RG7e3UsVhiO1r3/JJDp2R13+W76MagXhifrN2aAu07p2/HsvAlfGQa+CUYakpj 9kSiBEGTbLYPO6SnJ/SdNKkSt+zd+Uw+CrkplpGM/bgr7UOAQHUxvInO8EON3pRyyPLZ nVexe1qhCBNz8zfQ7NAepl7R8jxWyKsFNdcn1GNbviI64D91wHln3fasBPZYIt3Vfqq2 7HCzwW89nbfcPmiHYmtfWYUbwRvH3f0OPIvCMNO6Jvb2hjb3jivcps8tLSqciszLhm0E YleJRGgOuE2F5mB4bcCzMu2Epn5z1WUicl5dhBK7LPL6Jn2mIdX7g/7KWBOD1+PM/eWi 9q2g== X-Gm-Message-State: APjAAAUaRqbKpNrfHdirZLihrJkZbIha52C0fh4UE7ve5cWrTAcbOWz6 SMYcwC2UsBgWMB/zTab2g92Ckw== X-Google-Smtp-Source: APXvYqzhP1wlAEJn46lkdHp/9E6c8bJo+91ZhySivB8e8kdz5lOe0JajZRG4VPh/2MGrflPoMMhIIQ== X-Received: by 2002:a17:90a:3483:: with SMTP id p3mr4996354pjb.108.1569521123591; Thu, 26 Sep 2019 11:05:23 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id 193sm3956718pfc.59.2019.09.26.11.05.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 11:05:20 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 11/29] vmlinux.lds.h: Replace RODATA with RO_DATA Date: Thu, 26 Sep 2019 10:55:44 -0700 Message-Id: <20190926175602.33098-12-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" There's no reason to keep the RODATA macro: just replace the callers with the expected RO_DATA macro. Signed-off-by: Kees Cook --- 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 ad3578924589..0d86fc8e88d5 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 a24b284f5135..eca6c452a41b 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 3a4c1cb971da..9520dede6c7a 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -513,9 +513,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 Thu Sep 26 17:55: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: 1168068 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fNgp3Y87z9sNw for ; Fri, 27 Sep 2019 04:27:18 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="KLMaaspi"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fNgp1f48zDqwH for ; Fri, 27 Sep 2019 04:27:18 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::542; helo=mail-pg1-x542.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="KLMaaspi"; dkim-atps=neutral Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN0D6Qn4zDqkc for ; Fri, 27 Sep 2019 03:56:28 +1000 (AEST) Received: by mail-pg1-x542.google.com with SMTP id o10so1957624pgs.6 for ; Thu, 26 Sep 2019 10:56: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=rv+0o5mJKqlMVqhb1qXAA1i/NAPfwklm1J1wPL8Rg+Y=; b=KLMaaspib7B9k3L/1fjMwxKFPEIRUIbpqLyP7POH8bfp98DccIDvMUY0g/JO8OD+IN yHHIJMMU6qn805SoMyIRfugF7Tq24dOAzvst7C2KmNwTMJj/RAmnNHk+jLu3WZplt2Zq Wt/ngd69A/ym7jGwQZ5tUEQ8U9Lc+GLLZx1vk= 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=rv+0o5mJKqlMVqhb1qXAA1i/NAPfwklm1J1wPL8Rg+Y=; b=PmQWFCg74XZSag4EsIB0VBxdQypoPqYJA6vk72uN+QWYh+00oEOnO2dogmGX7cbo6z DQ4fe0l6xyZRo0x5KpVFkz2aJS254svY99Aa9gjz3xkHbA5R5a8oQxBQyi5WY6IHfWYW pleAB+FYS7J5FipctOQdT+licBDP9iZ4i6yqmbN79pU2IZ0TiEqdTV0B6Wp6qNVbIN9F Hhwe6JSt+JysVT+ppAtSFIySGGb5Faa/3/S+YlK9IrTuoKSeqNk9y9QvWAKVZH1cd0CS R3vyBISs9ykAtINRXeMZa8JknpbP4HOl98aYhgXsoF1qegXApPEQdCLgiztfAYuy/7iL Cu2A== X-Gm-Message-State: APjAAAUDlmObxFdnt0BGX6ZrOg/B3dy0no3HQHiLBE72nzF1Vl9HqwJh Tcq3Y6tHhAMaR2vlx6js3JonHg== X-Google-Smtp-Source: APXvYqx0rFDBs+mkI2PjjMDWWKbtBTnPHLojfYZE0HyLFhA1JQjLM+1gn1UCEg3Av7cuqozcAO0fqQ== X-Received: by 2002:a17:90b:f11:: with SMTP id br17mr4904149pjb.80.1569520586710; Thu, 26 Sep 2019 10:56:26 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id v5sm3337154pfv.76.2019.09.26.10.56.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:26 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 12/29] vmlinux.lds.h: Replace RO_DATA_SECTION with RO_DATA Date: Thu, 26 Sep 2019 10:55:45 -0700 Message-Id: <20190926175602.33098-13-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This finishes 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 --- 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 9520dede6c7a..cdff8ba42d4d 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 = .; * @@ -358,7 +358,7 @@ /* * Read only Data */ -#define RO_DATA_SECTION(align) \ +#define RO_DATA(align) \ . = ALIGN((align)); \ .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ __start_rodata = .; \ @@ -513,9 +513,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 Thu Sep 26 17:55: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: 1168072 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fNmQ21gxz9s4Y for ; Fri, 27 Sep 2019 04:31:18 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="JPB5LQLx"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fNmP1FLszDqpM for ; Fri, 27 Sep 2019 04:31:17 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::542; helo=mail-pg1-x542.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="JPB5LQLx"; dkim-atps=neutral Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN0G6DLkzDqs2 for ; Fri, 27 Sep 2019 03:56:30 +1000 (AEST) Received: by mail-pg1-x542.google.com with SMTP id i30so1989124pgl.0 for ; Thu, 26 Sep 2019 10:56:30 -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=DP2f1KA2/16QVKAwgl4FPVQv6pIlQfqHoh9XvDcRiiY=; b=JPB5LQLx7R8CPzmmMtIgLiAu9SH/wXvVsyj6Y0yD0Y6iVtIIaKjmL8t3vwlHtt6/G0 BXUQmzN2d3ziuX/j8aETjn+9/86QhvifAQjAtcLbekQW6+HjGphGZzMPPoyIvgkx73Ov g9ID6HsEvbow4tPVcolf3p7jGeWFf6SMlQgnw= 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=DP2f1KA2/16QVKAwgl4FPVQv6pIlQfqHoh9XvDcRiiY=; b=NVq0toNLhRaoKVTwjTOEf75us3MKkLgZS6TDc2WbxtBY4lr1PY1OGIbyuUPGki5Vyc A8z04dZ07tsgVXjxxZ9MzwUVGsLX59N8UL2TfU4BXy4fY1g35za10/Ss37ilKrLGQ3vh n34PTMRJRMFkv6/LWqD2L6iVQWNMFzZT6T5o4Fgqpu3jDq1zK/3BC7aKzFutmEVfKY/X wFWF7Xuz0WcSqkxIwyCIq47pX55PEkIfZ+aAbFUJb7aWlC6ixeznNl2lW0cN6eaNPXzl uSfz2YrNs/DLjOfLFWIR0mu651yXxK1aN7180XcWHFOrK7SgCCSWyc+aXG+8H7tgAlDC dMLw== X-Gm-Message-State: APjAAAVrArCYy7pW8OrvqE/qaCGOqIt9tk3lbPsWTUMPgYiZmYSusXMy T0sIU4e+PfRd1Mqrvho2xhDbCA== X-Google-Smtp-Source: APXvYqyq8Ul86nwgFhXb+mgCA4NCr/WUNBYfi1ABm6TFPjeX/uc65KYwNcaO1RObqpWc6rI/bOIQqg== X-Received: by 2002:a65:68c4:: with SMTP id k4mr4632028pgt.180.1569520588369; Thu, 26 Sep 2019 10:56:28 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id 195sm4707578pfz.103.2019.09.26.10.56.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:26 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 13/29] vmlinux.lds.h: Replace RW_DATA_SECTION with RW_DATA Date: Thu, 26 Sep 2019 10:55:46 -0700 Message-Id: <20190926175602.33098-14-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This renames 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 --- 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 5cf9424485d5..81d94e371c95 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -205,7 +205,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 cdff8ba42d4d..d57a28786bb8 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(...) @@ -969,7 +969,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 Thu Sep 26 17:55: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: 1168067 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fNd20ckcz9sNw for ; Fri, 27 Sep 2019 04:24:54 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Kt0MPBp1"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fNd16hqrzDqht for ; Fri, 27 Sep 2019 04:24:53 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::542; helo=mail-pg1-x542.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Kt0MPBp1"; dkim-atps=neutral Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN0D5cWZzDqnx for ; Fri, 27 Sep 2019 03:56:28 +1000 (AEST) Received: by mail-pg1-x542.google.com with SMTP id w10so1954989pgj.7 for ; Thu, 26 Sep 2019 10:56: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=4OoO9/kqQZ9xXFd9jmzh+sji+0+urCkP2+LVDe5fGPM=; b=Kt0MPBp1vWYay/J6CTJNxtKhAw6G5wCCoEhbJ7e0+7qQp53wQoH32XMsB7VcjjW8cx 4n5ei4jcLt5cOlGxwseK9CUNEa1PwMGgojB41dyPkTZ+0nnKv4yyR9ehnWwAElksl0oo UL/EWa4ETLAK1IJlRMikbUdclaao+PPrUmFXo= 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=4OoO9/kqQZ9xXFd9jmzh+sji+0+urCkP2+LVDe5fGPM=; b=A7hoQv+WwOqEYIzzpgtRovfwBdBIP0LZLdYOvMcRQVTkJbIX2HND/vN3PBDiWIAofU j7sPsN2JdR8zirENCav9S4MxbVcjzhKlBoHe8XpQ5V9J68yDprhYONi0lVmWSOgIl8QU c1RKl5y8Y07uDok659LTxLV5kchzTgi01lgVdapdDXNvoSqFNCvyh2tpFo8fakmheCOw YhJbVkrd8SiizgLPERVQKimLyIyZmhy8aMg6EYNY0u/hlKDz54z+lVtuQRvDR2Z/0/kF EDa93BtYZDBPAIU+Vv5kWq0fuPp93NUFi1EFrOZg1yb1rNsmTVB9r324WJlw+HtnH4En ABFA== X-Gm-Message-State: APjAAAWC7RH1aDvX8vYcJMixtQaZv8iOXG21ZI0V7t74GeD0N/r47TGZ qA+mbrOA3AwW0pDcpc4se4qzxg== X-Google-Smtp-Source: APXvYqxweRYyy+FuCakseDUP9otT1JrAAZ6K77sV80DCrLZqyiEF0oUZBPpm9+PnY/7XVYYbKaiWnA== X-Received: by 2002:a63:e514:: with SMTP id r20mr4651534pgh.275.1569520586692; Thu, 26 Sep 2019 10:56:26 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id d10sm1358129pgm.4.2019.09.26.10.56.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:26 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 14/29] vmlinux.lds.h: Allow EXCEPTION_TABLE to live in RO_DATA Date: Thu, 26 Sep 2019 10:55:47 -0700 Message-Id: <20190926175602.33098-15-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Many architectures have an EXCEPTION_TABLE that needs only to be read-only. As such, it should live in RO_DATA. This creates 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 d57a28786bb8..35a6cba39d9f 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_DATA_EXCEPTION_TABLE_ALIGN +#define RO_DATA_EXCEPTION_TABLE EXCEPTION_TABLE(RO_DATA_EXCEPTION_TABLE_ALIGN) +#else +#define RO_DATA_EXCEPTION_TABLE +#endif + /* Align . to a 8 byte boundary equals to maximum function alignment. */ #define ALIGN_FUNCTION() . = ALIGN(8) @@ -508,6 +519,7 @@ __stop___modver = .; \ } \ \ + RO_DATA_EXCEPTION_TABLE \ NOTES \ \ . = ALIGN((align)); \ From patchwork Thu Sep 26 17:55: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: 1168117 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fPWN3qkxz9sP6 for ; Fri, 27 Sep 2019 05:05:04 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ZT90Hlbg"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fPWN2nwGzDqY0 for ; Fri, 27 Sep 2019 05:05:04 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::643; helo=mail-pl1-x643.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ZT90Hlbg"; dkim-atps=neutral Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fNBd0fg2zDqfp for ; Fri, 27 Sep 2019 04:05:28 +1000 (AEST) Received: by mail-pl1-x643.google.com with SMTP id q24so1355252plr.13 for ; Thu, 26 Sep 2019 11:05: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=l1/coTYTe+wj6TaniwTTIjxs1/tlAJ4ZBZ+k2HAUhoc=; b=ZT90Hlbgza5mA13/d6UGS0pzfZxLKfXWME64PvV9Xl8CYO2kbvJSsEXc4JwWRHrHWB InrMjw1u0CbOHhrlMXR26Z9Pb5c7tAJ8jH6LE/YESZsEJSUAo4/QiXnuUcayFxkX0Me0 dj1EzZmZAVOcOsMHTRIfYk2DcenQKhga/VkuQ= 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=l1/coTYTe+wj6TaniwTTIjxs1/tlAJ4ZBZ+k2HAUhoc=; b=JA5buSNZ1CF5hnBdJ+grQPcOB3wzfSWJFGh9DfYZIFki8XPdG4MIeiL/Pa3mpGFrCu CDlmFp/H6a19iFJoCCMF1prVEU/6FzFaixztrju2IXFbAxKklBisAI69v/HQrOSQgEaO jViPTyKYgAhfb8f98l3i18tMnnUW4y1J0SIp0e7W7Az2N2S4pyROsx/f4MqKAbSkrMxJ 4Jba31oCORc4rUSXFEh/KL5boybNnkORI6zq2MvwLbp08zT2fu2hXvRPwXI+nVhXzqPE iTOUPOatntFTSgwcUzf+ABFALm6yQ6caNEGIeE2wbNacC6ggftQBr5Sd/skuxTXLXwaT 2img== X-Gm-Message-State: APjAAAVXhxJXhg5GxWXiRL+s0kVlg1j8NnhetgYfd9GqHhMXXH4vLSqj Eg9Y7Ncae6+Em+6aJOTHcHeX9Q== X-Google-Smtp-Source: APXvYqwfZ1Op5CLpaniFH9tifhvJSxbOiM4V28ay34Ix7SESkioQ0yE1zEBFSFMDhs1Uhrrf1XeYJQ== X-Received: by 2002:a17:902:ff0e:: with SMTP id f14mr5388358plj.325.1569521122967; Thu, 26 Sep 2019 11:05:22 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id b69sm3327625pfb.132.2019.09.26.11.05.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 11:05:20 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 15/29] x86: Actually use _etext for end of text segment Date: Thu, 26 Sep 2019 10:55:48 -0700 Message-Id: <20190926175602.33098-16-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 b196524759ec..bd3404fd9d80 100644 --- a/arch/x86/mm/pti.c +++ b/arch/x86/mm/pti.c @@ -572,7 +572,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 Thu Sep 26 17:55: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: 1168099 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fPGp1b1Rz9sP3 for ; Fri, 27 Sep 2019 04:54:10 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="YyccQSUv"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fPGp0LCszDr2j for ; Fri, 27 Sep 2019 04:54:10 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::641; helo=mail-pl1-x641.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="YyccQSUv"; dkim-atps=neutral Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fNBZ0KjdzDqMd for ; Fri, 27 Sep 2019 04:05:26 +1000 (AEST) Received: by mail-pl1-x641.google.com with SMTP id d22so1650643pls.0 for ; Thu, 26 Sep 2019 11:05:25 -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=LBq+xea/ZmJQ/9uj4ezLaR0vyHYQneqqBGeQvqqFY5g=; b=YyccQSUv7s3dpyKNfcnsTuVNk/Y6kwXh+M8oxRRtdUgW8nSUtTYRC0g/WriqeXH9y2 wwVCXNxHIivS7mTiFSK+TSyzV+h8hVp4SAUn1izuVQbvw0l7XMGaQM6lK95NH4vmtwbU BZR9POA+VLIcdjNACdsaoN48Vcx862rY58h7Y= 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=LBq+xea/ZmJQ/9uj4ezLaR0vyHYQneqqBGeQvqqFY5g=; b=kookLMNmyiTlO1yfeooz1IT+m2LdKx/mmlShKMuDA5OqzE0DYx4pcymB9SXy8NS1nH iTmKtk8EVZeOhDNY9LTvyoSZcZ4+FdDy5gBppCYho40vP5ovOlIjOmmsP3YamMigkyfg s8+a2n0oX4wpLx7FulXyBc8K5F98uy/gAy9GBqrYLUuhs8sv1ihlYxC0PeVAJkKb7ZLG LdO3Si9uWVNbb6lud4WIErlUNIlzZGDOtsDeKyH/HwfIpDakjJrMdg+WErXEuMfVjgC9 DUtGydRIO1z0Px2niwDdyJ5rl/KKnmzjnzU6B8OoMprgDFdf+eccuw/kusYCLBYjf5oF gikQ== X-Gm-Message-State: APjAAAVbkgjBTUOMKXVRUac6Vr/rkxxgI3h/TJkMJTknviYOq+nLo63w FWDY867tCB81cp0RZ539vjeKFA== X-Google-Smtp-Source: APXvYqzkn6dvMB+EvQiPjIgquz94zhqgnJASSzAj4vbdHobiWS7v9jA7Bv9z5kMPyHOm+3eNniFkDQ== X-Received: by 2002:a17:902:a618:: with SMTP id u24mr5406606plq.76.1569521121016; Thu, 26 Sep 2019 11:05:21 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id e127sm3746231pfe.37.2019.09.26.11.05.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 11:05:20 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 16/29] x86: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 26 Sep 2019 10:55:49 -0700 Message-Id: <20190926175602.33098-17-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The exception table was needlessly marked executable. In preparation for execute-only memory, this moves the table into the RO_DATA segment via a 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..a5c8571e4967 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_DATA_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 Thu Sep 26 17:55: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: 1168074 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fNs90zrMz9s4Y for ; Fri, 27 Sep 2019 04:35:25 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="NS1tMZPO"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fNs8753KzDqq7 for ; Fri, 27 Sep 2019 04:35:24 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::442; helo=mail-pf1-x442.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="NS1tMZPO"; dkim-atps=neutral Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN0J0kSwzDqsD for ; Fri, 27 Sep 2019 03:56:32 +1000 (AEST) Received: by mail-pf1-x442.google.com with SMTP id y72so2226300pfb.12 for ; Thu, 26 Sep 2019 10:56: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=b1/uW6kDsyZTSJ+gwaKuf5Y3ySZgNCgjZ9WgbQU3J5M=; b=NS1tMZPO6DiLtYsg7bkcpePHNmJ/nLyEn8bFqB536OAMsynj/sM0sV9JASHY+/D/aV 0irY/ZZ/Sw5Ff6a3Xr8hTMKPFlLAyCjdwPHuVnFq7tw1NS7SnAKb8YnaFIBVxhT0Mjeq faTnz/PfHNqDfDu8NYYA9Yvm+scVClDMmdf/U= 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=b1/uW6kDsyZTSJ+gwaKuf5Y3ySZgNCgjZ9WgbQU3J5M=; b=aDB4v3ohG4q53MTunkTS6hR7osB4+teT0Pm7CCiNt56PUzCb06S7o1HCVNoJDoxeJB c7f6+1gAObhix2aa6GsAgDOJd1v98JWugCs7Qg5OI6TfzxolDMgWyJTenV1VQuFoYB5e VlzO5VasixwWvokKmt/wl9Q1pGxKWObZf7E8umSVDSsjIg9XArji+/77lhQo6jq5arzF yosDmJSCF5gAMpvClAq6/spRVaJyDOi7r+MZfZ4ci6kQ23aosmpHHfQBiQvLmylrDH4f 9bmeV3J4s0jiQTO5DgNkPj052vuRH42pJdAgCzDyxgqG3ktrUbOg3PZLRpcFUWULG/tx U3Yw== X-Gm-Message-State: APjAAAX4E/zJysAJYoAS8japUattpG2HUBg+C7602NwGDmzbEtW9ewzw r7fr6YLHFsTPb6XU3/yqJIX/wQ== X-Google-Smtp-Source: APXvYqxnFFNqQpUkqna8OeByYxEA/Nx8utFzCAqw8OBF0xZQgqdbBmLWMEJr85fjA0ZYcRUxNYx6WA== X-Received: by 2002:a17:90a:37c9:: with SMTP id v67mr5020846pjb.29.1569520590214; Thu, 26 Sep 2019 10:56:30 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z25sm2899187pfn.7.2019.09.26.10.56.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:26 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 17/29] alpha: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 26 Sep 2019 10:55:50 -0700 Message-Id: <20190926175602.33098-18-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The EXCEPTION_TABLE is read-only, so 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..72303827bcb4 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_DATA_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 Thu Sep 26 17:55:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 1168070 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fNjv6Q3Qz9sNw for ; Fri, 27 Sep 2019 04:29:07 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="odBS6czN"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fNjv3v7hzDqwm for ; Fri, 27 Sep 2019 04:29:07 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::544; helo=mail-pg1-x544.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="odBS6czN"; dkim-atps=neutral Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN0F60YlzDqqW for ; Fri, 27 Sep 2019 03:56:29 +1000 (AEST) Received: by mail-pg1-x544.google.com with SMTP id i30so1989111pgl.0 for ; Thu, 26 Sep 2019 10:56: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=sVPOVPq0jGnDyk9BlFn1nbib25butANPcZ2psxH1XQk=; b=odBS6czNjAFbywCHRPpPNeXtF6OPc2mmJ7PZLPLZJwd6gvLuxf+a4qKWHGXqogA0yi p2vEtxVP/XOxYN9zPFrI5aP6IZ37YGa0bwxcd1Y/fvdWegAkmT28yuhfe+dV29/aNHth 17TyUbj6jzLSgZ65Pr6zSq3TqTL6Z/E1LQYkg= 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=sVPOVPq0jGnDyk9BlFn1nbib25butANPcZ2psxH1XQk=; b=RHf4/p7GM8hF/JdK/hnUnhNa2w0UzSdzkzvoSQKiPPtTI8HArHYc+QZ9R3DlIhBrSI NMlgEkR/sp9QtThXJNPNttmbbXLPeEV0r1TXTJqXbSZ/O9Ne91Nn64mjr7C4yjrW6B06 T4G0408gawFnYVOP6YEsNZvtkg46On+v/ki6R3kD/81z1Stye8r5txA5G730Rl2D1MCR H0X80EUfky6zf/Ib+DsfouRDQGfKF1BPSyRwT0eTEFQToBnaesLRIqXaxFDMkWT+0sKD CaghQcKbXktPstdxGO+UjWyGq9v5R2jRhvdltBhTsVdcdtxh3i+l3rNekjkidWM+s0TG mHJQ== X-Gm-Message-State: APjAAAWKD9jbdtWgp7HMmQ+yNxcP14Qz9TucaujVzjQtGacVJpgEIvC0 +JEJX4dbDA8tvFgKVDXDUJdRAg== X-Google-Smtp-Source: APXvYqxubPgpOdgeHae/TiPTi3EhrP4iQjDpvLFArEZMN+uNbmRmza3nNTs+U0Mb+pu60jodhZwxMA== X-Received: by 2002:a17:90a:2481:: with SMTP id i1mr4939410pje.77.1569520587801; Thu, 26 Sep 2019 10:56:27 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id v19sm3224270pff.46.2019.09.26.10.56.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:26 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 18/29] arm64: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 26 Sep 2019 10:55:51 -0700 Message-Id: <20190926175602.33098-19-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The EXCEPTION_TABLE is read-only, so collapse it into RO_DATA. Signed-off-by: Kees Cook Acked-by: Will Deacon --- arch/arm64/kernel/vmlinux.lds.S | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index 81d94e371c95..c6ba2eee0ee8 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -5,6 +5,8 @@ * Written by Martin Mares */ +#define RO_DATA_EXCEPTION_TABLE_ALIGN 8 + #include #include #include @@ -135,8 +137,8 @@ SECTIONS . = ALIGN(SEGMENT_ALIGN); _etext = .; /* End of text section */ - RO_DATA(PAGE_SIZE) /* everything from this point to */ - EXCEPTION_TABLE(8) /* __init_begin will be marked RO NX */ + /* everything from this point to __init_begin will be marked RO NX */ + RO_DATA(PAGE_SIZE) . = ALIGN(PAGE_SIZE); idmap_pg_dir = .; From patchwork Thu Sep 26 17:55: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: 1168073 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fNpZ3wtyz9s4Y for ; Fri, 27 Sep 2019 04:33:10 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="XMqGnRk/"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fNpZ2jkWzDqxG for ; Fri, 27 Sep 2019 04:33:10 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::543; helo=mail-pg1-x543.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="XMqGnRk/"; dkim-atps=neutral Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN0G742hzDqs6 for ; Fri, 27 Sep 2019 03:56:30 +1000 (AEST) Received: by mail-pg1-x543.google.com with SMTP id o10so1957669pgs.6 for ; Thu, 26 Sep 2019 10:56:30 -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=boKac6TElydY4R3sQa+G+xBcabSsdI+sqtUCLKc0I3Y=; b=XMqGnRk/4L2zV+BAcfMhEdp30WQ7rnrwPghldhN5wojxU6yECwV0QZoiKh6iMFz9u/ 3s0+7zK9FZyUnOl5vKrLaXkQbtdXFR/JEp6wPtBe2BjahHGB5QibvDfI2zsDQKGVGwxT 0FaowxFjLAW78Z95w7zWRvBJowS42QkoAtE9E= 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=boKac6TElydY4R3sQa+G+xBcabSsdI+sqtUCLKc0I3Y=; b=RC5BDVrpQKnv/wK02mhideULtOUtXqBNERQtvAPQYXH94LbeAV59EBfieicBbQu7/e oW7Dob/FA9WEVZfQ5c3Pd6IaE/8k8XIT9lTNsSM8kz0vsRY88VdBWfzapwwBvqNbu1Ik q8C9NhwtV0pWBhhrt0JYYpeb29DlrCedr35ieK2Lmtd+QTX8TEsPP+tE3eCooyEUn3x5 u8avCKiw/b7uBh5fxmPV+PZqkvlZLizto5lJR0H7bwHyQFcPqA0NZRWtwYspBDEUsAAl cCU0zL64IY+UBLvzrZxD6KJWATEGEySWU71yVi0Jld+CNu9mBeBFjEe0jT+eltY6dwdX 2Eng== X-Gm-Message-State: APjAAAV0ZfX9hpdin5dKzPw4LBxTrXT++9stI7zV9TOY50by5mqkI2l2 xS/ytxekBawvnFIZp0ZGFII8ig== X-Google-Smtp-Source: APXvYqw3JiUTFBC2pu3wWAh2sSRbsTCox9kS4uccJrMuCcRqw869/J5FYUi7LMMoz7vy/oYtsvV+iA== X-Received: by 2002:a62:6489:: with SMTP id y131mr5133495pfb.71.1569520588899; Thu, 26 Sep 2019 10:56:28 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id m136sm7333082pga.94.2019.09.26.10.56.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:26 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 19/29] c6x: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 26 Sep 2019 10:55:52 -0700 Message-Id: <20190926175602.33098-20-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The EXCEPTION_TABLE is read-only, so 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..9a09aab63ab3 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_DATA_EXCEPTION_TABLE_ALIGN 16 + #include #include #include @@ -80,8 +83,6 @@ SECTIONS *(.gnu.warning) } - EXCEPTION_TABLE(16) - RO_DATA(PAGE_SIZE) .const : { From patchwork Thu Sep 26 17:55: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: 1168086 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fP0v1fgCz9s4Y for ; Fri, 27 Sep 2019 04:42:07 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="KPMZBnze"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fP0v0TPbzDq7d for ; Fri, 27 Sep 2019 04:42:07 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::441; helo=mail-pf1-x441.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="KPMZBnze"; dkim-atps=neutral Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN0M5PQyzDqqD for ; Fri, 27 Sep 2019 03:56:35 +1000 (AEST) Received: by mail-pf1-x441.google.com with SMTP id q10so2285388pfl.0 for ; Thu, 26 Sep 2019 10:56: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=HjFHv9xxIhK5RJeBiuSF34CW9EFCi2H1cUI0osZb25Q=; b=KPMZBnze/A/QVrsTLF2KGN3ebdUhyckFs45P2jOghM70xqivIFR9hfivXkVt5CbeNY IE1kSylnyZRNl8HDUTfbWj8AKjNJnMw62zdeR5tu6VCLH496t+W13oMohTiMGaZ6p79Z 3c4uLS8nqL5lvrbWSW4400GI1UZ1nPH1jjAIE= 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=HjFHv9xxIhK5RJeBiuSF34CW9EFCi2H1cUI0osZb25Q=; b=RwUTcnZ+ttcLpk4amtW6VA5szrkBuKhrs5JV3g52wKiuwYSVN0MDTXgPWH/sYyf4DR gEch7skXEAC2nO1LOyOMmXS4lXQouplf51aUSdeVJ9eZvGG/WGnoGJ83HyFjSyqaenKo Ng4KAyPc+dcM1VoC3SV0GEhVX5Z6+b54ZFWLWTqepH643jAfpD7WQQTDFzdPzJ12DCM6 fw1JO1Y3/RjyATI0N7cner9tE+OMDtZHd1nOSCOggEFtXfnGrIXs5zo1WqDUW2+87IFk enEnXn2gBQXrCvHD2YqQN7xvF/x6MHexWMrxb27XNhpUZfbq2tnW1/qOo4cwaUwId1pN RJCQ== X-Gm-Message-State: APjAAAUeVA859x10W0BTXR+G+fyF6VqKKLavV/RkSFAYOm4ofiLbYhTe NhtNaTooEoMLNCzDyjXgsM/iZA== X-Google-Smtp-Source: APXvYqyFMbRLlIoK6p9J6QIn/93x5dhozlYQ0YGx3wABZc+vZZjpU1J4N8nao/7zNkR46rXeo7ym8w== X-Received: by 2002:a62:19c7:: with SMTP id 190mr5160181pfz.105.1569520591920; Thu, 26 Sep 2019 10:56:31 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id f89sm3068052pje.20.2019.09.26.10.56.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:30 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 20/29] h8300: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 26 Sep 2019 10:55:53 -0700 Message-Id: <20190926175602.33098-21-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The EXCEPTION_TABLE is read-only, so 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..aba90398b774 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_DATA_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 Thu Sep 26 17:55: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: 1168114 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fPSz53Wbz9sP6 for ; Fri, 27 Sep 2019 05:02:59 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ftNNGKyt"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fPSz42WbzDqcG for ; Fri, 27 Sep 2019 05:02:59 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::542; helo=mail-pg1-x542.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ftNNGKyt"; dkim-atps=neutral Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fNBd0ffYzDqfN for ; Fri, 27 Sep 2019 04:05:28 +1000 (AEST) Received: by mail-pg1-x542.google.com with SMTP id z12so1958934pgp.9 for ; Thu, 26 Sep 2019 11:05: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=UZe87vLT1sniPvXW68EajTgvCPzHcGOx1KtJdkMO+C4=; b=ftNNGKytJacyrySBqQdQBy+Wtbqo4hjOH8JbjKAUhiSKwHnh85Hu/NyJx15BBuO1wF yvNx/PBqQnIZ6l+s3uDBiFHBJFB+mgrq10000RAmGyv/9dd3TBhxlAe1FDs1ODYyqFBp 20hAVjREm+IqibqFYhMmuhOtQ05fbch5Col5A= 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=UZe87vLT1sniPvXW68EajTgvCPzHcGOx1KtJdkMO+C4=; b=uRrjaozlFx0Pzql7urhCpLb82bWmd7/GKCa4HBnv/FwDkgjCEUHyGbTER3BSyMB+zf 7H8zl1YM/QtEV+VcUbDp/Rwtfz+UDZaiPs25bLBoZT9eLfN8KsFtuhr9Cx8pUEqaGW1G sZoyKbSIHUXkBowKQorbpMefWsZhf+myJ0Joi/vX4Qq/XoCiooL3YxinOJwwOHzQFLXv 9KaH/fRn0xMAi9AizPCb9eeB0veOP4VtZ/Yfjbk4oESm4+gdYcmCWVNDuhmtuFLqd4Rc gdu7oBEfZDE4ujEiWlxMsWILRLUipTt8mDNBU/9lLuQ447kr+Na8R7WHcruoy04uZu1/ GT4g== X-Gm-Message-State: APjAAAWPaUNMs1xeVH8nEkdXqY3vAQ+YUR+P+dL9lt10ImUbG68B65SP yd8hIWdWp6JGuwkM5jVX4xxC+Q== X-Google-Smtp-Source: APXvYqxQ+qIP8fVJv40/72tfoaela/T+aeXyqhEWc1AJXKMb1mslUhfwVxI+PEohiV5y6ZiRW2Bx2Q== X-Received: by 2002:a65:5689:: with SMTP id v9mr4732387pgs.228.1569521124506; Thu, 26 Sep 2019 11:05:24 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id p17sm5229278pfn.50.2019.09.26.11.05.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 11:05:23 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 21/29] ia64: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 26 Sep 2019 10:55:54 -0700 Message-Id: <20190926175602.33098-22-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The EXCEPTION_TABLE is read-only, so 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 0d86fc8e88d5..18a732597112 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_DATA_EXCEPTION_TABLE_ALIGN 16 #include @@ -70,7 +71,6 @@ SECTIONS { /* * Read-only data */ - EXCEPTION_TABLE(16) /* MCA table */ . = ALIGN(16); From patchwork Thu Sep 26 17:55: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: 1168103 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fPK86j2Tz9sP3 for ; Fri, 27 Sep 2019 04:56:12 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="g+0oLVAq"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fPK85MSKzDqnR for ; Fri, 27 Sep 2019 04:56:12 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::544; helo=mail-pg1-x544.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="g+0oLVAq"; dkim-atps=neutral Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fNBY4sWlzDqlX for ; Fri, 27 Sep 2019 04:05:25 +1000 (AEST) Received: by mail-pg1-x544.google.com with SMTP id q7so1943036pgi.12 for ; Thu, 26 Sep 2019 11:05:25 -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=2XFXeoGzN1a69pdrls3Beu9JzTpe303VvDFe7zacy8U=; b=g+0oLVAqgoC2ew3EG5pLyiK4x/TqojlpwWAAFR+n2zcKEHaA+12gz1WCbQcTKhnK8V du7myxKhRoFz8Vn350c/04sX/0q1TmPiCjT+hhJhaVb0xaMcrKAjrM6bAOhht8bRTLF/ Rvlu7BrJq+bmPv67tsPaw4XYg0FUkK7Uc3Zrc= 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=2XFXeoGzN1a69pdrls3Beu9JzTpe303VvDFe7zacy8U=; b=h3f4/6ZsZ3Khvg5sNUJOUMkLZHtRzpkISfi1zQSDju46iT8O37uZygvwMPkg3qlpW8 J4ehLziXFKAqaFHkQMx8lXOeRsNN69PNCS47rzznai/+ZmpmIJDypNZiVhibHEgTA1p3 yrW/sPOa9nzvHWnH3yjqOuerLgLZVHDeR+FwnvkBdzJG5Kna4TKbdmWl97BcxaC2NXBJ s0j0D/oHlAtF229DP/LGN3dfQc1kDEb+0GaQLUdjCt0fL8d2T6VsyLiyBgd6FiV+wQ5Q ni4P1KBdbHq86CHiwYQX9PPGHmV9OlQzcIcZTyfqVJXJVOAduD2QYj9XcOL9tt4aLoJ3 8mfw== X-Gm-Message-State: APjAAAWhqZALu/c8wkGmlmSZI1cnGt8H7qZBMz/+oTXCQB2MRW/+Z58Y LxMhWmyt+lguXljaWG+bgVdYAQ== X-Google-Smtp-Source: APXvYqz61iDdqBAe+eZrQT2tMeg7B3FlHieVQyDUPoWyOaOfAOoRrb/ef7ZJD9oTwPZs33YIQXx+4w== X-Received: by 2002:a63:ff4a:: with SMTP id s10mr4691464pgk.166.1569521122354; Thu, 26 Sep 2019 11:05:22 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id v44sm8488912pgn.17.2019.09.26.11.05.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 11:05:20 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 22/29] microblaze: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 26 Sep 2019 10:55:55 -0700 Message-Id: <20190926175602.33098-23-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The EXCEPTION_TABLE is read-only, so 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..abe5ff0f3773 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_DATA_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 Thu Sep 26 17:55: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: 1168108 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fPMc6tmnz9sP3 for ; Fri, 27 Sep 2019 04:58:20 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Yg3+62ar"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fPMc50KpzDqgB for ; Fri, 27 Sep 2019 04:58:20 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::641; helo=mail-pl1-x641.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Yg3+62ar"; dkim-atps=neutral Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fNBY5DQ1zDqmq for ; Fri, 27 Sep 2019 04:05:25 +1000 (AEST) Received: by mail-pl1-x641.google.com with SMTP id f19so1640472plr.3 for ; Thu, 26 Sep 2019 11:05:25 -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=oto3YJoz+uDS7YkHckkDLPsuLHSJE59Ic1Zvlvk3JIM=; b=Yg3+62araTz65OUjSMd7uRtDTc4qLv27ScfzOQEBsjmErC4baR+vactZeQ8EDHTDl3 4m6/i6nTkUszRwcGPx+4rzXQZxnWhhz2/IpIkxEyLfsUcTwCPuJ3shP5kaVVlXFxeae6 oJjvZwVhpbm6kHMwMmWob89Fc5KJC8pyBS2O0= 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=oto3YJoz+uDS7YkHckkDLPsuLHSJE59Ic1Zvlvk3JIM=; b=CkHoCloV4Vfa4wLGK4otIzyl4mRWIG37EYMt8Owk8qyks75qBz6Cfz1L7thd4ofKcC 0VAU+y8TjSwObmH4EKJ7v5g5YY5+a4ZpEVRoLGkIRh4X+WWjpI3x+J+eRuSrfLNgD4aH vZ5E3N5K3NeexKKRtvE6lGoUSIiovGK8nzdHGKU4FAEOZ7OmvdNAyjDeGD4HE7WFwAmD jTyhZyDkYatD5OX3CRYZI7AvPK5XfFqZ4Ngsf1YQcjLTCnw13OX+1JEn2oQNqxwxNpmH LtuChkgruB3I0NhpRnyy93Kqy2hI/SkNwi+Kjg9Hg4XgoW87i8T8vk5iKTpUcOL/k3Vg JFFg== X-Gm-Message-State: APjAAAWU0KBr+H7wwkfaDE8WI2KRd0Q7VxdG2xTvVuKvagYv5VHHv0ty OKRnbf/p3EbBXlDRzzJYzGpmgg== X-Google-Smtp-Source: APXvYqyRIx3xRHb+mNaLLP0zVX1hp9OZQXgJDPhnQfQ+Lb8Ihhv0yx8B8A03PaGE2C0DjuqCQpfKMg== X-Received: by 2002:a17:902:be0c:: with SMTP id r12mr5340803pls.190.1569521121688; Thu, 26 Sep 2019 11:05:21 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id k15sm3366000pfa.65.2019.09.26.11.05.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 11:05:20 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 23/29] parisc: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 26 Sep 2019 10:55:56 -0700 Message-Id: <20190926175602.33098-24-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The EXCEPTION_TABLE is read-only, so collapse it into RO_DATA. Signed-off-by: Kees Cook --- 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..1dc2f71e62b1 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_DATA_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 Thu Sep 26 17:55: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: 1168087 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fP3Q3V0Jz9sP3 for ; Fri, 27 Sep 2019 04:44:18 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="GqCpdlt2"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fP3Q0dc1zDqyh for ; Fri, 27 Sep 2019 04:44:18 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::442; helo=mail-pf1-x442.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="GqCpdlt2"; dkim-atps=neutral Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN0N2c5mzDqs1 for ; Fri, 27 Sep 2019 03:56:36 +1000 (AEST) Received: by mail-pf1-x442.google.com with SMTP id a2so2240551pfo.10 for ; Thu, 26 Sep 2019 10:56: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=DewAllPq01LncnaE6NYCCskktLTPQ+Oq7qAAM5yWaKA=; b=GqCpdlt27oIxoalJ+q55GpBWVA+O9B4EMwRWAPEitDTY5x/y/r3wW9KbkZvPr2V4X/ S8caIKThukUOlDs2WCows35gv3FJcnOv4JTcjIQERxd+vzGaspWFjmHz3dbggEHqAL0H 9XgrssZH7A/r46cr0/K6ftOAUAm1WnB4t7vdU= 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=DewAllPq01LncnaE6NYCCskktLTPQ+Oq7qAAM5yWaKA=; b=UN4Ux66C0dqSEvXUSVOW5iZBf4xsJo0AgmZdO5KlhehnSbIJqfyP4Za1/jLcXbbCKU Ft6qInOfTtdyTnErxpqcSqjbI4vyIkMTgxzQsSK4ketquDH4Ri3NC/jgoU2uT+/6S680 49bzOjFWFMXuTFjD03j8JM4Kr+ITY3ArrKmR40EZ9bAT4qAu4l/bccpY6zyblHj//Cnv 8rBXjnNR50lGKbxJL7TqPl84Klve+ia80Nn4JA+3PZQxLVTorH24H4c3zHLtE7ThjOJo PoHv8dhHdDbTZcTErGZTdV24ffhin7PR2x8FMIAm64zkLxTIoTjmCkULTq3dZZ1So+lw Ufsw== X-Gm-Message-State: APjAAAWsS4i58A7exFcoLuKpceY5NXLv/EkQdkmcfPw0Dq2zQ/7MAI9t PJXH82KhbR70XsZy+virvBwQqg== X-Google-Smtp-Source: APXvYqy6lsJedhQhLRYmBsUadf9UZQvX3qa3S7SjzPO8c/ioUQ997KVZPcsBQte8g5aQEg6d61NfYg== X-Received: by 2002:a65:5c0b:: with SMTP id u11mr4650029pgr.294.1569520592850; Thu, 26 Sep 2019 10:56:32 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id m2sm3024583pgc.19.2019.09.26.10.56.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:30 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 24/29] powerpc: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 26 Sep 2019 10:55:57 -0700 Message-Id: <20190926175602.33098-25-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The EXCEPTION_TABLE is read-only, so 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..2ed44e5824d5 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_DATA_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 Thu Sep 26 17:55: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: 1168081 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fNyf6D1pz9s4Y for ; Fri, 27 Sep 2019 04:40:10 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Ki0F6+sL"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fNyd43vBzDqpB for ; Fri, 27 Sep 2019 04:40:09 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::442; helo=mail-pf1-x442.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Ki0F6+sL"; dkim-atps=neutral Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN0M6TXJzDqsM for ; Fri, 27 Sep 2019 03:56:35 +1000 (AEST) Received: by mail-pf1-x442.google.com with SMTP id q21so2232712pfn.11 for ; Thu, 26 Sep 2019 10:56: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=lY3gLtq1yv4TCNLsCOhid7qXT7bvA83WxioIIIqFVXA=; b=Ki0F6+sLs6VORroy0ffqnJseBA7QSYUqd1wFP0NbS4cak1Wh3YkGMRzQvtEEccudzG edctuQ/eEwwU5sHQJ5XfK3VeDlq6muLK9g3jC02FBRdOySPAoLy0gCS9CBjGysbAQtpV XAVWcStOY/x6BsVgnubCCJ1P6LNHIFc/5/2+c= 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=lY3gLtq1yv4TCNLsCOhid7qXT7bvA83WxioIIIqFVXA=; b=t/9l0tZzHNJeWwhN4kagwPfjN/BTEsfUddEao7FFfB+VpL8T0pbOTPmU4or/MFqDkD hnaBv4ZXT6MlJPWqdvcMZC/HiDVWdIizp5yfcpnePODDuYKqc24FrfSVukEyVHGQPDoF phNAPD8EgtIuqjrewKv5/VksFkElAo8sbDNm9eK80rgcAJVlFGj8mLFFB1Gfmvq2KH0w aEWnNzP3uAB8O5qHOT5kqlWvm90XHdPEQDREUMStsD9Jq8f8Zvdagi/2UlSC8IsnFRqU Npl9cdaxOxTD1PBGfoVqPcpU7Nwgx7U4LZZalyIAx2S45Lc3APXwBksdY9kMietSCtBs qvQw== X-Gm-Message-State: APjAAAXmiirTBaDpcpDvqrZ/cHerjFf8TLRMOQ6rahpywyvATfLOAOFs G8R6aB/tj41etVL1lhC8LRTGvw== X-Google-Smtp-Source: APXvYqzUFG+7+GBGC0jBD0+mR//mqQSm/qKVQf8bQR8gVQHifb6ysRylAOP5049ta8XmpDzMuRucBg== X-Received: by 2002:a65:500d:: with SMTP id f13mr4684873pgo.359.1569520591224; Thu, 26 Sep 2019 10:56:31 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id 8sm2842378pgd.87.2019.09.26.10.56.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:28 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 25/29] xtensa: Move EXCEPTION_TABLE to RO_DATA segment Date: Thu, 26 Sep 2019 10:55:58 -0700 Message-Id: <20190926175602.33098-26-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The EXCEPTION_TABLE is read-only, so collapse it into RO_DATA. Signed-off-by: Kees Cook --- 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..7341964722ae 100644 --- a/arch/xtensa/kernel/vmlinux.lds.S +++ b/arch/xtensa/kernel/vmlinux.lds.S @@ -14,6 +14,8 @@ * Joe Taylor */ +#define RO_DATA_EXCEPTION_TABLE_ALIGN 16 + #include #include #include @@ -130,7 +132,6 @@ SECTIONS .fixup : { *(.fixup) } - EXCEPTION_TABLE(16) /* Data section */ _sdata = .; From patchwork Thu Sep 26 17:55: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: 1168094 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fPBv3hpQz9sDB for ; Fri, 27 Sep 2019 04:50:47 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="h2p8CR6C"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fPBs3zYYzDqWS for ; Fri, 27 Sep 2019 04:50:45 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::541; helo=mail-pg1-x541.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="h2p8CR6C"; dkim-atps=neutral Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN0Q2vnRzDqnx for ; Fri, 27 Sep 2019 03:56:38 +1000 (AEST) Received: by mail-pg1-x541.google.com with SMTP id t14so1974737pgs.3 for ; Thu, 26 Sep 2019 10:56: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=0o22aj+Q2fPal3OzyLNHtFtEJCV1jKXrih1rnY9ZOvQ=; b=h2p8CR6CTCVG0EcWBzFZk9M7pS5/grZV7SzSB6Fp/b72sOhC+rJHHanRbr647L3D5O 3PK+ZsRgr4yUne37ilhSCOXRu+oA9brL1Q3zUBwCc+GNAanTNZBOlRbFkU/6xiHKWXKz z9Lk6mr7quDbn6Iv5uFqVP/gtakRm/cG9s24k= 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=0o22aj+Q2fPal3OzyLNHtFtEJCV1jKXrih1rnY9ZOvQ=; b=KRtQGv8ickwBSIf96ILGZwlxn+JjNSqzSESGmDGO/wR19oGbqfQHYl+wJBIeyxE8D+ PIM215XqcI3zgmIV4V3KxPfghVuetDYjOlKOk2XAyPu20snNcgG9aJ5bBvKFnEaVV/fk sPKI6LLxnumM15kGNmd030Ee+VTnW7y7Irkupqawjzpq1j3Pj3aQWYE/5GNN8gvb9eH3 r4j7XSiQPEPd7rTO8iSw2cl7V2m5gu7nqrnBJ8ay0Q8fKcdF80fFAemE7Sj2N99fGvSu oW9zZeW2vYYKD3I2mbEcbKjcSF9mafcXWUvGMP2X23HHnlzDSzXz3IpCshUp4bWN4QSe eI7g== X-Gm-Message-State: APjAAAVAYS2SBpPrihaGjP+TmZZi+w6pXMM83Y0ACvVQ1D8JrZxqv160 jJPS+KhkqV2Y9eFfiT27/hDhdQ== X-Google-Smtp-Source: APXvYqy6S7VpAjQkHoN68ZupzJjzmnjjpPcZsaZVMPIKEdbkFn7g1SNyoioq3hB1BxaJQAQsFZhPUg== X-Received: by 2002:a62:7a88:: with SMTP id v130mr5261721pfc.184.1569520595802; Thu, 26 Sep 2019 10:56:35 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id t68sm6742712pgt.61.2019.09.26.10.56.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:30 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 26/29] x86/mm: Remove redundant &s on addresses Date: Thu, 26 Sep 2019 10:55:59 -0700 Message-Id: <20190926175602.33098-27-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The &s on addresses are redundant and are better removed 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 Thu Sep 26 17:56: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: 1168091 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fP5z6D45z9sDB for ; Fri, 27 Sep 2019 04:46:31 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="UFt+V8/B"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fP5z598XzDqyl for ; Fri, 27 Sep 2019 04:46:31 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::542; helo=mail-pg1-x542.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="UFt+V8/B"; dkim-atps=neutral Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN0N40NgzDqsN for ; Fri, 27 Sep 2019 03:56:36 +1000 (AEST) Received: by mail-pg1-x542.google.com with SMTP id x10so1964184pgi.5 for ; Thu, 26 Sep 2019 10:56: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=lMtAqLKIV7iaSMLHYcvPv+kohztZyY/Z+5xJ+D8O728=; b=UFt+V8/BMr/oQ/8CSnatqgIyXSDcvs3/19JyozsCgFPsqS0v3M/8jZg1fzL6Qc1wTN zcaktCKmkfBZrskzRVnW1lpnKnbT1CTtX0kHIF9idT+XJVt92g3bq0Dpz4OLE6nMC5XH NW8BhxFynv4qPmoQ9WfuzroS1lPcxOvqA3Vq0= 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=lMtAqLKIV7iaSMLHYcvPv+kohztZyY/Z+5xJ+D8O728=; b=nZ5S4vsNvRaq/dpEDbDjnLNmCijlifwiuidZPjVOewFoIS8DdrAwKkgRnBQ0z2yQAu jgFWoSsrg03CW7b3O6cemlLUPVDqSKiNbmHiZXcldGJir+iIczNZP0oVICrmkvl9xJg0 SGC5fh5b6LrzGAxHoTd3JU46rCafRmn65wBsPXdFO1vKydMEPkqwQGZ2aSUtqD4s67AO 0YYBb7nr1lgmAgrCaxyRAOVYVOINb6cfXT5TyVbAf8Ct06aFzGC2708KdvwVHlRf/fuq nje1XHmo9ZfIz77ZcV/O6k0OJx6L2folk9JFYtZ2XqXRyLBFGtFucIU/924YgQO8i7aI y56Q== X-Gm-Message-State: APjAAAVjSmBTdw2/wDI8g4Nm27SKBnjUk0c31g1th1+fwEylN2aYyl08 IYOEZPla2x5BylRDbfG6cHh1SA== X-Google-Smtp-Source: APXvYqx+mrEmgBwFBIoSkO5Knd2FiUPuYbkq8tX7W4zsQact6t42C/glSDDrgO3H24UWPs5jK1YgqQ== X-Received: by 2002:a65:5905:: with SMTP id f5mr4751014pgu.332.1569520594154; Thu, 26 Sep 2019 10:56:34 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id 22sm2887306pfo.131.2019.09.26.10.56.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:30 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 27/29] x86/mm: Report which part of kernel image is freed Date: Thu, 26 Sep 2019 10:56:00 -0700 Message-Id: <20190926175602.33098-28-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The memory freeing report wasn't very useful for figuring out which parts of the kernel image were being freed. This adds the details for clearer reporting. 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 Thu Sep 26 17:56: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: 1168093 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fP8W6Vqtz9sDB for ; Fri, 27 Sep 2019 04:48:43 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="CyY/fdEz"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fP8W1G0JzDqvt for ; Fri, 27 Sep 2019 04:48:43 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::542; helo=mail-pg1-x542.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="CyY/fdEz"; dkim-atps=neutral Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN0Q4tYczDqqW for ; Fri, 27 Sep 2019 03:56:38 +1000 (AEST) Received: by mail-pg1-x542.google.com with SMTP id c17so1970180pgg.4 for ; Thu, 26 Sep 2019 10:56: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=7AxBS2UV+sou48Vy6Kv2h9T7DXggZ06m6xu8Azn3KL4=; b=CyY/fdEzQgm0TyKUDxy3G75sTcbk4Yw8tvueMHwbpgUZtbJ0Xvon+CXNyKvyrH1BQL u5o6uFwm+e/OcHUC7jySe7aCPARo15vlMXuk5vFXe2FB4K6jNA/Eh3EruiLhkgWYgaHg gq6pWp7Ua54wgWact2q/huVGG+j/PtSDlqWQg= 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=7AxBS2UV+sou48Vy6Kv2h9T7DXggZ06m6xu8Azn3KL4=; b=XoY+SMEc+tUyEjMNLH+2nrtyZb76NQOzBu4TyvK3mwD7AS0odA8Ve70XA45KCR4UV/ qajG87u+MV9mfiyAsKBtmPt9stuPNyREzyCKk/ISD04mY1/tbrMvPh1pvj6mVFj/PR9s vs4VCSUsQwlCXauG+NeCMwWrR4oZxj60RuYCPYdwhou5YHgIKiuDA/opcbdGxC05LQqY aCtC+kHwEVH5sfnatQZU8NQD7KKrODsD8Q+sfmtdgbOV+RW8Qf1aHbay9KL3RiRD8wcC 4ZqRim79KVT3nNa8vRU7ObadoAk3sZq+PqicGwDu+YHkLEde8CNKofYETI10uCpDxDCj gLUg== X-Gm-Message-State: APjAAAXqxWpjM2NTD1km3+wB8emCeY7k6a2HImuoI87r304Jo0WeRJp5 BwBnGczTGLDZzHAyK/8L0xc6yQ== X-Google-Smtp-Source: APXvYqxknkDJzH/r0j7lYxibttZvFSpKr+f+b+F+1vun52i5pglb7KvJVrIclOAHVzYu0ZWp0UtBWA== X-Received: by 2002:a63:5050:: with SMTP id q16mr4553788pgl.451.1569520594732; Thu, 26 Sep 2019 10:56:34 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id i126sm3220459pfc.29.2019.09.26.10.56.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:30 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 28/29] x86/mm: Report actual image regions in /proc/iomem Date: Thu, 26 Sep 2019 10:56:01 -0700 Message-Id: <20190926175602.33098-29-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The resource reservations in made for the kernel image did not reflect the gaps between text, rodata, and data. This adds the rodata resource and updates 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 bbe35bf879f5..0bc71ee3a9c3 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 Thu Sep 26 17:56: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: 1168080 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46fNwW1RV4z9s4Y for ; Fri, 27 Sep 2019 04:38:19 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="GIG4pntI"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46fNwW0CYRzDqxf for ; Fri, 27 Sep 2019 04:38:19 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::542; helo=mail-pg1-x542.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="GIG4pntI"; dkim-atps=neutral Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46fN0N1zndzDqqW for ; Fri, 27 Sep 2019 03:56:36 +1000 (AEST) Received: by mail-pg1-x542.google.com with SMTP id y35so1985736pgl.1 for ; Thu, 26 Sep 2019 10:56: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=yn5wfwJoFu2XxkEapi5oUode7Z6ofSq2WooR/oMOeig=; b=GIG4pntI4mSLZBUOLoFMk4guSw8F6GtVAwhEFiBddEsAgwrkRwPjIGbLRlxFjf3FFl AAkc2fNz+FhNHp9iA1Gn1CLcywcbJ+TQMeOOKdi3rLClFQao449j+D61pfii2Lo6mCp9 gdFOurgujqWI728AB8TNIMWAJHUqnNxeyVafk= 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=yn5wfwJoFu2XxkEapi5oUode7Z6ofSq2WooR/oMOeig=; b=QrKVUxbTdaFhweCT+bxozhFQwBcDBNEIQdHFZSAcoQBZljUCPk7luk84ulnCO/72Z3 Hj5awxW67r2u3r0GqqDqQtWZO7g8GDbFTrzD9u4wtJZESQxgoHCufoCqO3Um7+VWHnmW VYnfJ8sa045wKl0eGYG0mnrsV3BsqwiegpJ6JBJWyfmPuADYpoAk9HaSG0Aa/Znp4IWh zR/b0CrR+RfBH1LCW2YcR/l4BDJlpW0ySO6zzeT0DhRV2PSUjgfF9sMDSvu+JMySC1T7 gW2d5YHN23YuxourRFw+SMA0JHeQpbpi01+UbpkogJF/WhIvAN4g/YP737ymDUoXL8yV V9Yg== X-Gm-Message-State: APjAAAWzV3GRqCsAaG1PXSztQzaKe7Btkfo5cfbow8uVh4PmKdBMOQRm 00LuYfnBiJju24m7lQxvvrHZEA== X-Google-Smtp-Source: APXvYqztKKvfKjgB5MJEkhZ1uiyu1Mkac35wqulYkyxXb+7C2TAggJBadFx7VmxAR9W2f3IICOin9w== X-Received: by 2002:aa7:920d:: with SMTP id 13mr5075737pfo.17.1569520593466; Thu, 26 Sep 2019 10:56:33 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id x6sm7506434pfd.53.2019.09.26.10.56.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:30 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Subject: [PATCH 29/29] x86: Use INT3 instead of NOP for linker fill bytes Date: Thu, 26 Sep 2019 10:56:02 -0700 Message-Id: <20190926175602.33098-30-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Dave Hansen , x86@kernel.org, Yoshinori Sato , Ingo Molnar , Borislav Petkov , linux-parisc@vger.kernel.org, Andy Lutomirski , "H. Peter Anvin" , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 drops 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 a5c8571e4967..a37817fafb22 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 = .;