From patchwork Tue Nov 22 14:28:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101474 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp2124351qge; Tue, 22 Nov 2016 06:29:30 -0800 (PST) X-Received: by 10.84.136.1 with SMTP id 1mr194040plk.152.1479824970833; Tue, 22 Nov 2016 06:29:30 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r12si28656983pgn.241.2016.11.22.06.29.30; Tue, 22 Nov 2016 06:29:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933472AbcKVO3P (ORCPT + 26 others); 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 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0LiYwK-1cjdLI3Axo-00cezJ; Tue, 22 Nov 2016 15:28:32 +0100 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.9.0 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