From patchwork Sun Sep 3 12:07:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 9936111 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 B80B96037D for ; Sun, 3 Sep 2017 12:08:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9EC4286A9 for ; Sun, 3 Sep 2017 12:08:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9EB3B286B3; Sun, 3 Sep 2017 12:08: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 A78F9286A9 for ; Sun, 3 Sep 2017 12:08:49 +0000 (UTC) Received: (qmail 7729 invoked by uid 550); 3 Sep 2017 12:08:36 -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 7551 invoked from network); 3 Sep 2017 12:08:34 -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=9/7dHbpFD4D1dJwLNVhR63gUTZrSEJJwP37i3VxFnkM=; b=K8pBCNMqPmW5bNMjiu2oniHXJq1ycbC2oHTIH2BguvmRumRClttG7pTLd26OUui6AT fwgDlv3WI/Hp9JuUCZK3Wtke66gJgkPHWgffWaNivrAvV0i4rBmZG41ofaRucryjvXLy 31OXwaz3ww93HEjCGMQZmuHRCFbTk93HNy1xk= 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=9/7dHbpFD4D1dJwLNVhR63gUTZrSEJJwP37i3VxFnkM=; b=XfYYAi5gmPo0AVPN3RQcvlS3Gk7LbuEID4S2qIKbPTQh/hn23QLkhzd0mYLpImS2rS 4U+6pING2LpTDq/Adky5AXtOFLi/dy3veq5yJ9uzxKXACeDyXEn7z2USveDRVOx787qj simdXEft4/GV1DfeNpnVRgpsHYEfVRId4b33IuxSSO3qwCxVx7Z4Xko+63IDTCxAZyL5 z2YBPByAQqQXY535soPVSjhiXcSaybprrG0OnCdEoVRsGtLluhmpEb2UfkSLX5tpDI6t 7128GK7BR9h5VbUxr0kZabmezDAd5lO0sC+I12JN2hGIS+1ULv8Qs1rPA84S17BLfOT+ aMLA== X-Gm-Message-State: AHPjjUic44duXjwkxJgBlPZNEt0jMOJZxjdORHofl5ay76N3dJq6L9T9 q28+dpr8lZBaVhT9cuLv3g== X-Google-Smtp-Source: ADKCNb6RHYpF6vn5ZdOQNBMX7adW3aDPj+U1rQS/yIMR5o9P3myyK+qZOwd9x2e0fQbClf765XZiLA== X-Received: by 10.223.145.5 with SMTP id j5mr4136054wrj.148.1504440502864; Sun, 03 Sep 2017 05:08:22 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, kernel-hardening@lists.openwall.com Cc: Ard Biesheuvel , Arnd Bergmann , Nicolas Pitre , Russell King , Kees Cook , Thomas Garnier , Marc Zyngier , Mark Rutland , Tony Lindgren , Matt Fleming , Dave Martin Date: Sun, 3 Sep 2017 13:07:30 +0100 Message-Id: <20170903120757.14968-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170903120757.14968-1-ard.biesheuvel@linaro.org> References: <20170903120757.14968-1-ard.biesheuvel@linaro.org> Subject: [kernel-hardening] [PATCH v2 02/29] 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. Acked-by: Arnd Bergmann Signed-off-by: Ard Biesheuvel Acked-by: Nicolas Pitre Acked-by: Kees Cook --- 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