From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752070AbcKGTuq (ORCPT ); Mon, 7 Nov 2016 14:50:46 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:32778 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751790AbcKGTun (ORCPT ); Mon, 7 Nov 2016 14:50:43 -0500 From: Chris Metcalf To: linux-kernel@vger.kernel.org, Kees Cook , Heiko Carstens , Martin Schwidefsky Cc: Chris Metcalf Subject: [PATCH] tile: handle RO_AFTER_INIT_DATA Date: Mon, 7 Nov 2016 14:50:27 -0500 Message-Id: <1478548227-3476-1-git-send-email-cmetcalf@mellanox.com> X-Mailer: git-send-email 2.7.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is the minimal change to handle RO_AFTER_INIT_DATA. The tile architecture already marks RO_DATA as read-only in the kernel, so grouping RO_AFTER_INIT_DATA with RO_DATA, as is done by default, means the kernel faults in init when it tries to write to RO_AFTER_INIT_DATA. For now, just move it past the end of the RODATA section so it is not specially treated. --- This is just to fix 4.9; I will post a more complete fix shortly targeting 4.10. arch/tile/kernel/vmlinux.lds.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/tile/kernel/vmlinux.lds.S b/arch/tile/kernel/vmlinux.lds.S index e1baf094fba4..dcd7445c31a2 100644 --- a/arch/tile/kernel/vmlinux.lds.S +++ b/arch/tile/kernel/vmlinux.lds.S @@ -1,3 +1,6 @@ +/* Handle ro_after_init data on our own. */ +#define RO_AFTER_INIT_DATA + #include #include #include @@ -87,6 +90,7 @@ SECTIONS _sdata = .; /* Start of data section */ RO_DATA_SECTION(PAGE_SIZE) + RO_AFTER_INIT_DATA RW_DATA_SECTION(L2_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) _edata = .; -- 2.7.2