Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933471AbcKVO3P (ORCPT ); Tue, 22 Nov 2016 09:29:15 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:49249 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933267AbcKVO3N (ORCPT ); Tue, 22 Nov 2016 09:29:13 -0500 From: Arnd Bergmann To: Russell King Cc: Jakub Kicinski , Catalin Marinas , linux-s390@vger.kernel.org, Martin Schwidefsky , Heiko Carstens , Andrew Morton , Arnd Bergmann , Chris Brandt , Kees Cook , Nicolas Pitre , Chris Metcalf , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: fix kmemleak for XIP_KERNEL Date: Tue, 22 Nov 2016 15:28:11 +0100 Message-Id: <20161122142829.1776129-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:nDJTKDEubQVLBlP/IfWCLIxgfqukE61cl7/SnT/6GF8MRKn2OsU LqnsnA5kIB0EPOJest3XVGSrBXcL96lwb3ysZ7UFNwA4MpFaBjdd5Te0sQ2kp/1yD9Q+r14 X5MI01XAX5sxvbnhhK7KU03n0zllSjJNsNFeg2iYqMkClO4kvQIsOiPK6o2fbNuby56rSTN GSeO9rwhKcYqL0YARlrXA== X-UI-Out-Filterresults: notjunk:1;V01:K0:S9b98ZBUx24=:N+5V0KNo1Rs8dZPYKIciAF fW0LIQ1UNe8pMbmTC0Qdaq+hGj8fzJejdCCp7uOD278Hrt+RhrWAhR9mcRL1NL+UKmVckRrVq mbXZpcnd7sE2h4XxV/KuWTIbI7RI8vE3ybwNc1eAauCQeg229Vp/AtvDqsmJJTbvksu2zRqp6 DYf03ceVDCfB3Iih3CEXNNMmI2yuKRsANmQjvpZffwchMyTB9HmKl8eZwEmZ2JIDFl0hiOhOx NBZu4kStgstzSnc0ESUa+3a+nS4gAbHSwAIBxzLDVuzeSX6KPTR+Tb+Hh5f0Sv2wYPcRDIx1N rG938i8tC7HwM3BaO+btygYWiIumY+aPuW0LmAPuHW3PPNU6gaEAjT27qHWVPRKzw/o71zdmg LUycxhLK+oervt0XIcAUGidvA6fy+UfH5MUDsnY3q4jU+znTJmM9Em3qtYbULYufdzKixWi7d 1CYsHTzgd3qL3Lk1i17p6mmEAvsU6FXrU/ZYwZPx1kwQPqfWEn5dANBJx8UWFcsRIfRBNQc1a 5WfgF438sMicVsDKKpqIvpdhNK5EJvrNf7gz9mOc/tCHxpIrLJQ+wWo14xfffRwQYS8jJ4cRk URiPT68CrSvKzvyOAD7TabEMW764FUQMpBk1FjNrmVIgH+xZIvGGVDhS54pWmYwVcDsWF1niJ RrlY337PQZtYiLY8iOExQ8MK4nv+aMMKvh3BwQKnbiwecbtaa/7VFY84h4KItohTZOFo= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1579 Lines: 42 The newly added check for RO_AFTER_INIT_DATA in kmemleak breaks ARM whenever XIP_KERNEL is enabled: mm/kmemleak.o: In function `kmemleak_scan': kmemleak.c:(.text.kmemleak_scan+0x2e4): undefined reference to `__end_data_ro_after_init' kmemleak.c:(.text.kmemleak_scan+0x2e8): undefined reference to `__start_data_ro_after_init' This adds the start/end symbols for the section even in the case of having no data in the section, to make the check work while keeping the architecture specific override in one place. Fixes: d7c19b066dcf ("mm: kmemleak: scan .data.ro_after_init") Signed-off-by: Arnd Bergmann --- The patch causing this was merged late into v4.9-rc, this one should probably go there as well. I assume the same problem exists on s390, but I have not checked that. --- arch/arm/kernel/vmlinux-xip.lds.S | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arm/kernel/vmlinux-xip.lds.S b/arch/arm/kernel/vmlinux-xip.lds.S index 06c178214629..bf900f5421a1 100644 --- a/arch/arm/kernel/vmlinux-xip.lds.S +++ b/arch/arm/kernel/vmlinux-xip.lds.S @@ -3,8 +3,11 @@ * Written by Martin Mares */ -/* No __ro_after_init data in the .rodata section - which will always be ro */ -#define RO_AFTER_INIT_DATA +/* empty __ro_after_init data in the .rodata section - it will always be ro */ +#define RO_AFTER_INIT_DATA \ + __start_data_ro_after_init = .; \ + __end_data_ro_after_init = .; + #include #include -- 2.9.0