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 85B62C433F5 for ; Fri, 11 Mar 2022 10:36:23 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9mzxFSbxNVP8d4APeafVxXOQ23OZ4g8Aeuvli8ntPq0=; b=YEi8zDpG+zXDQO 5sql/Bzv85xbZvjz1aseFiDfhONnF9+ApfOlcgtXrPbQRUtoh45meCO/B6NF37JDcx9q/IBK+ba/i JxGjsACY966vk9Euw5saHQZ5IDTDflfF1HeBm6mkinIcSF5AuAVA2/DGtCuHD5E1GgxzARsXlBtxI Zl1RnATcKm1guG90vDfswbdu3In6tabUQKDYrlMoVNmJ8UVlmEC82iinGQY/DVr7/+7wX2zR7n7CR fQDVZfotc0Mm7l/6jjXV4f1eoYOO3wd/POq7vz/gain5hXix24S5VuggKMYdFbPFtUFY4p64vOfJF dYQKVrR2fRGfkjE4oqOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nScbx-00G1T4-Uf; Fri, 11 Mar 2022 10:35:06 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nScbt-00G1QN-7i for linux-arm-kernel@lists.infradead.org; Fri, 11 Mar 2022 10:35:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uyaT3+EVPViBMT6fbeRdikl9gpqbHKai7w6iSnQ9lMw=; b=GNpys08Jj1EfZyuN/R7NoIsNZk 7ASPesLjsnYaKm7NwsDst25U/lFQfC+AldmV6gQxutMIbG4EjikFcX4MK5c1NPmMuTMo9oQvSEkRp 0LGqjJ60GoW0wUA6Je8sO5vH4fp2F8tp6iautLO6lIgLH1DzEHWL2dGAj3aVZ2Pe32mfK8Rk0W7m8 AnarrN5QihUBjV7vRo1VhopTsJDJ4827e8hf2v3URH53rqaUE77gSxmJWEH7EBZwjWn+YjzyQkcv/ 5rMd5Z50WiEVamsjxWZF9Lc/JEQ5x+euXagDty4qw/qJyiDRvJ7uNNakOY4BATe4NykZGETzlZ+O5 wcKah0aA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:57786) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nScba-0002Qe-Qz; Fri, 11 Mar 2022 10:34:43 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1nScbX-0001Wi-Bk; Fri, 11 Mar 2022 10:34:39 +0000 Date: Fri, 11 Mar 2022 10:34:39 +0000 From: "Russell King (Oracle)" To: Lecopzer Chen Cc: linus.walleij@linaro.org, linux-kernel@vger.kernel.org, andreyknvl@gmail.com, anshuman.khandual@arm.com, ardb@kernel.org, arnd@arndb.de, dvyukov@google.com, geert+renesas@glider.be, glider@google.com, kasan-dev@googlegroups.com, linux-arm-kernel@lists.infradead.org, lukas.bulwahn@gmail.com, mark.rutland@arm.com, masahiroy@kernel.org, matthias.bgg@gmail.com, ryabinin.a.a@gmail.com, yj.chiang@mediatek.com Subject: Re: [PATCH v3 1/2] arm: kasan: support CONFIG_KASAN_VMALLOC Message-ID: References: <20220227134726.27584-1-lecopzer.chen@mediatek.com> <20220227134726.27584-2-lecopzer.chen@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220227134726.27584-2-lecopzer.chen@mediatek.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220311_023501_323001_74AB0593 X-CRM114-Status: GOOD ( 19.60 ) 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 On Sun, Feb 27, 2022 at 09:47:25PM +0800, Lecopzer Chen wrote: > Simply make shadow of vmalloc area mapped on demand. > > Since the virtual address of vmalloc for Arm is also between > MODULE_VADDR and 0x100000000 (ZONE_HIGHMEM), which means the shadow > address has already included between KASAN_SHADOW_START and > KASAN_SHADOW_END. > Thus we need to change nothing for memory map of Arm. > > This can fix ARM_MODULE_PLTS with KASan, support KASan for higmem > and provide the first step to support CONFIG_VMAP_STACK with Arm. > > Signed-off-by: Lecopzer Chen > --- > arch/arm/Kconfig | 1 + > arch/arm/include/asm/kasan_def.h | 11 ++++++++++- > arch/arm/mm/kasan_init.c | 6 +++++- > 3 files changed, 16 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index 4c97cb40eebb..78250e246cc6 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -72,6 +72,7 @@ config ARM > select HAVE_ARCH_KFENCE if MMU && !XIP_KERNEL > select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU > select HAVE_ARCH_KASAN if MMU && !XIP_KERNEL > + select HAVE_ARCH_KASAN_VMALLOC if HAVE_ARCH_KASAN > select HAVE_ARCH_MMAP_RND_BITS if MMU > select HAVE_ARCH_PFN_VALID > select HAVE_ARCH_SECCOMP > diff --git a/arch/arm/include/asm/kasan_def.h b/arch/arm/include/asm/kasan_def.h > index 5739605aa7cf..96fd1d3b5a0c 100644 > --- a/arch/arm/include/asm/kasan_def.h > +++ b/arch/arm/include/asm/kasan_def.h > @@ -19,7 +19,16 @@ > * space to use as shadow memory for KASan as follows: > * > * +----+ 0xffffffff > - * | | \ > + * | |\ > + * | | |-> ZONE_HIGHMEM for vmalloc virtual address space. > + * | | | Such as vmalloc(), GFP_HIGHUSER (__GFP__HIGHMEM), > + * | | | module address using ARM_MODULE_PLTS, etc. > + * | | | > + * | | | If CONFIG_KASAN_VMALLOC=y, this area would populate > + * | | | shadow address on demand. > + * | |/ This diagram is incorrect. We already have the memory layout in Documentation/arm/memory.rst, so we don't need another set of documentation that is misleading. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel