From patchwork Mon Aug 14 12:53:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 9898785 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 10E1E602BA for ; Mon, 14 Aug 2017 12:54:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 06181285E3 for ; Mon, 14 Aug 2017 12:54:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEF3228602; Mon, 14 Aug 2017 12:54:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 28E08285E3 for ; Mon, 14 Aug 2017 12:54:49 +0000 (UTC) Received: (qmail 17521 invoked by uid 550); 14 Aug 2017 12:54:43 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 16036 invoked from network); 14 Aug 2017 12:54:39 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oY84BxHEmD5byvT9FOA+tlPAuiV9dkLSxj2uJjHGBjA=; b=ZwQPkdNv5M+DksRO92U1hSR/APgm9zTrEx8YvWFYq24Kfra0Oo7AhsZJV6Y4DJNN+4 whAGBioG9gtff3vTEEYTlLNaD/Cn5ap9XvhRAQpgNrYaMyfEMMvwZ4SyJKKl/y1Me6IF cIBJJYnlf+dmtaG/nCdMrDTtm3bbtog6DjoGs= 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=oY84BxHEmD5byvT9FOA+tlPAuiV9dkLSxj2uJjHGBjA=; b=AX65RWKhFnljsJkix8uJBXsXULSh5waQScidriBOeq2j6qhXImN0OxdASik0NC3oGt JHrYJZytnn9Lg5VSNAGdxULKDjKn4yhvrLzw1IIgokUNzCQ32NCi/UmxHjTddwNfMrHI zIRwbbjOkuOQH40h1mehNWNthvuuRo7iMJaYrGALDmE1jjswO63Bb1JgowF58/kadzKI 36BJqdmoEIbYT93QO2csg7EoHKsgfsAlhUQZ2s+bi39JqFhcp810Z6TrJgYB/lrro09I Ttn3ZmNkXofmZGoOpG3QHSpGzIvaPZAZqnbAJuD8rzULZYHOmRkpV6v1Y4547pHF+4aQ 6J/w== X-Gm-Message-State: AHYfb5iojJMsoOiS1xRcXLPXhiRqrojNxK0cTEEK3mZkdXHLc4ZkKkoM 3NvgsG0Lgq41ii2FUPhUnw== X-Received: by 10.28.95.133 with SMTP id t127mr3890767wmb.142.1502715268208; Mon, 14 Aug 2017 05:54:28 -0700 (PDT) From: Ard Biesheuvel To: kernel-hardening@lists.openwall.com Cc: linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Arnd Bergmann , Nicolas Pitre , Russell King , Kees Cook , Thomas Garnier , Marc Zyngier , Mark Rutland , Tony Lindgren , Matt Fleming , Dave Martin Date: Mon, 14 Aug 2017 13:53:42 +0100 Message-Id: <20170814125411.22604-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170814125411.22604-1-ard.biesheuvel@linaro.org> References: <20170814125411.22604-1-ard.biesheuvel@linaro.org> Subject: [kernel-hardening] [PATCH 01/30] asm-generic: add .data.rel.ro sections to __ro_after_init X-Virus-Scanned: ClamAV using ClamSMTP When running in PIC mode, the compiler will emit const structures containing runtime relocatable quantities into .data.rel.ro.* sections, so that the linker can be smart about placing them together in a segment that is read-write initially, and is remapped read-only afterwards. This is exactly what __ro_after_init aims to provide, so move these sections together. Cc: Arnd Bergmann Signed-off-by: Ard Biesheuvel Acked-by: Arnd Bergmann --- include/asm-generic/vmlinux.lds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index da0be9a8d1de..d16537b0b102 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -261,7 +261,7 @@ #ifndef RO_AFTER_INIT_DATA #define RO_AFTER_INIT_DATA \ VMLINUX_SYMBOL(__start_ro_after_init) = .; \ - *(.data..ro_after_init) \ + *(.data..ro_after_init .data.rel.ro.*) \ VMLINUX_SYMBOL(__end_ro_after_init) = .; #endif