From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1ADB5C433F5 for ; Thu, 23 Dec 2021 13:06:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+1Bo6dxcHJXMI73ipoZV7YyWdOweLT32atXUsANxahc=; b=ecBuHVLzitZ/7w Zwb4+BQU0OChpVZ+uR+ZjGwBWwPizzdAD798yOmRtHcshekDDH0HwxAIQntt4oppETnlxLcrTNdI3 jWfh0P8COg98xlyg57y+pUsaiSuy1l8Hy50LjWPxyRNlQ1OG1E8FZ1IUnChorrgbSkRw+DYuG0iLS hrhb9PEDnMUgq1K2T5LAHyTh4e0Se27Mk5OyDz5BGLBX9B0qh/HXWpyCeTMDXVYhemCHp5RNKqgPS kQ4MPMS3HylQkc0LVleIyE6uJlfTKBVu5I5n4uxKrbeMH954DD/SfpmnLuk+9/5x329X0Bu106QkN FWuWHcTXLXx2z02EC8ow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0NmF-00ClIj-1J; Thu, 23 Dec 2021 13:04:59 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0NmB-00ClHu-KD for linux-arm-kernel@lists.infradead.org; Thu, 23 Dec 2021 13:04:57 +0000 X-UUID: b8a3b1d3934540a6a536f64a5db12d04-20211223 X-UUID: b8a3b1d3934540a6a536f64a5db12d04-20211223 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 141606429; Thu, 23 Dec 2021 06:04:52 -0700 Received: from mtkexhb02.mediatek.inc (172.21.101.103) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 23 Dec 2021 05:04:51 -0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkexhb02.mediatek.inc (172.21.101.103) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 23 Dec 2021 21:04:37 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 23 Dec 2021 21:04:37 +0800 From: Lecopzer Chen To: CC: , , , , , , , , , , Subject: Re: [PATCH] ARM: module: fix MODULE_PLTS not work for KASAN Date: Thu, 23 Dec 2021 21:04:37 +0800 Message-ID: <20211223130437.23313-1-lecopzer.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: References: MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211223_050455_697955_37A3A3C1 X-CRM114-Status: GOOD ( 23.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > > Fixes: 421015713b306e47af9 ("ARM: 9017/2: Enable KASan for ARM") > > Signed-off-by: Lecopzer Chen > > --- > > arch/arm/kernel/module.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c > > index beac45e89ba6..c818aba72f68 100644 > > --- a/arch/arm/kernel/module.c > > +++ b/arch/arm/kernel/module.c > > @@ -46,7 +46,7 @@ void *module_alloc(unsigned long size) > > p = __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END, > > gfp_mask, PAGE_KERNEL_EXEC, 0, NUMA_NO_NODE, > > __builtin_return_address(0)); > > - if (!IS_ENABLED(CONFIG_ARM_MODULE_PLTS) || p) > > + if (!IS_ENABLED(CONFIG_ARM_MODULE_PLTS) || IS_ENABLED(CONFIG_KASAN) || p) > > > Hello Lecopzer, > > This is not the right place to fix this. If module PLTs are > incompatible with KAsan, they should not be selectable in Kconfig at > the same time. > > But ideally, we should implement KASAN_VMALLOC for ARM as well - we > also need this for the vmap'ed stacks. Hi Ard, Thanks a lots for your advice. Of course, I just simulate how arm64 did, It's surrounded by a bunch of IS_ENABLED(CONFIG_...). I think I could also send a patch for arm64 to move out the IS_ENABLED() to Kconfig. Actually I have a patch set support KASAN_VMALLOC for arm which is similar with I did for arm64, this patch is regarded as the first patch from the serise. But It has problems that it's very easy to run out of vmalloc area due to 32bit address space(balance between low and highmem), so the serise is pending and I send this patch alone. Anyway, I'll send v2 to move the conditioni-if to Kconfig. thanks, Lecopzer _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel