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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39BCFC433F5 for ; Tue, 14 Dec 2021 13:25:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 793936B0071; Tue, 14 Dec 2021 08:25:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 743B86B0072; Tue, 14 Dec 2021 08:25:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 60BBF6B0074; Tue, 14 Dec 2021 08:25:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0189.hostedemail.com [216.40.44.189]) by kanga.kvack.org (Postfix) with ESMTP id 5203A6B0071 for ; Tue, 14 Dec 2021 08:25:38 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0FF60886C2 for ; Tue, 14 Dec 2021 13:25:28 +0000 (UTC) X-FDA: 78916471536.24.91E625C Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf18.hostedemail.com (Postfix) with ESMTP id 9BB111C0005 for ; Tue, 14 Dec 2021 13:25:24 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 87773614E9; Tue, 14 Dec 2021 13:25:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08494C34606; Tue, 14 Dec 2021 13:25:22 +0000 (UTC) Date: Tue, 14 Dec 2021 13:25:19 +0000 From: Catalin Marinas To: andrey.konovalov@linux.dev Cc: Marco Elver , Alexander Potapenko , Andrew Morton , Andrey Konovalov , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, linux-mm@kvack.org, Vincenzo Frascino , Will Deacon , Mark Rutland , linux-arm-kernel@lists.infradead.org, Peter Collingbourne , Evgenii Stepanov , linux-kernel@vger.kernel.org, Andrey Konovalov Subject: Re: [PATCH mm v3 23/38] kasan, arm64: reset pointer tags of vmapped stacks Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 9BB111C0005 X-Stat-Signature: 1kt18bestsxxfbdidrxi481pdfr5iab7 Authentication-Results: imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of cmarinas@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cmarinas@kernel.org; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none) X-HE-Tag: 1639488324-801167 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Dec 13, 2021 at 10:54:19PM +0100, andrey.konovalov@linux.dev wrote: > From: Andrey Konovalov > > Once tag-based KASAN modes start tagging vmalloc() allocations, > kernel stacks start getting tagged if CONFIG_VMAP_STACK is enabled. > > Reset the tag of kernel stack pointers after allocation in > arch_alloc_vmap_stack(). > > For SW_TAGS KASAN, when CONFIG_KASAN_STACK is enabled, the > instrumentation can't handle the SP register being tagged. > > For HW_TAGS KASAN, there's no instrumentation-related issues. However, > the impact of having a tagged SP register needs to be properly evaluated, > so keep it non-tagged for now. > > Note, that the memory for the stack allocation still gets tagged to > catch vmalloc-into-stack out-of-bounds accesses. > > Signed-off-by: Andrey Konovalov Acked-by: Catalin Marinas