From patchwork Tue Nov 30 22:07:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: andrey.konovalov@linux.dev X-Patchwork-Id: 12648281 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 05806C433EF for ; Tue, 30 Nov 2021 22:12:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1E6656B0074; Tue, 30 Nov 2021 17:08:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 194B76B0085; Tue, 30 Nov 2021 17:08:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 05D056B0087; Tue, 30 Nov 2021 17:08:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0156.hostedemail.com [216.40.44.156]) by kanga.kvack.org (Postfix) with ESMTP id E84CE6B0074 for ; Tue, 30 Nov 2021 17:08:04 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A520D1815CBEB for ; Tue, 30 Nov 2021 22:07:54 +0000 (UTC) X-FDA: 78866984868.13.923119E Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by imf20.hostedemail.com (Postfix) with ESMTP id 96954D0000A9 for ; Tue, 30 Nov 2021 22:07:48 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1638310073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IXyg2OmXCwGvEgzJdDkzZ/hs5ydqycKFWdffFjeLykY=; b=s1AnY5h27kusC+7KxsIVZ6wRvZU3UewzI9HszyP42L8ajoEt/veaVlWMXgEs9OwN0kW8jA eddnoKtIlfK6druyh1YnaRXiMjuWWSjPRWUpSGdPe4bXtZjd/tiJetCMwqyVqIp8UycolK so8S9kcbXcrrS+sWSrwV2o9TQ3yakco= From: andrey.konovalov@linux.dev To: Marco Elver , Alexander Potapenko , Vincenzo Frascino , Catalin Marinas , Peter Collingbourne Cc: Andrey Konovalov , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Andrew Morton , linux-mm@kvack.org, Will Deacon , linux-arm-kernel@lists.infradead.org, Evgenii Stepanov , linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH 23/31] kasan, arm64: allow KASAN_VMALLOC with SW_TAGS Date: Tue, 30 Nov 2021 23:07:51 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Rspamd-Queue-Id: 96954D0000A9 X-Stat-Signature: psyiuim5tbqko66ftmo84psir1zddejx Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=s1AnY5h2; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf20.hostedemail.com: domain of andrey.konovalov@linux.dev designates 91.121.223.63 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev X-Rspamd-Server: rspam02 X-HE-Tag: 1638310068-360066 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: From: Andrey Konovalov vmalloc support for SW_TAGS KASAN is now complete. Allow enabling CONFIG_KASAN_VMALLOC. Signed-off-by: Andrey Konovalov --- arch/arm64/Kconfig | 1 + lib/Kconfig.kasan | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index c4207cf9bb17..c05d7a06276f 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -206,6 +206,7 @@ config ARM64 select IRQ_DOMAIN select IRQ_FORCED_THREADING select KASAN_VMALLOC if KASAN_GENERIC + select KASAN_VMALLOC if KASAN_SW_TAGS select MODULES_USE_ELF_RELA select NEED_DMA_MAP_STATE select NEED_SG_DMA_LENGTH diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan index cdc842d090db..3f144a87f8a3 100644 --- a/lib/Kconfig.kasan +++ b/lib/Kconfig.kasan @@ -179,7 +179,7 @@ config KASAN_TAGS_IDENTIFY config KASAN_VMALLOC bool "Back mappings in vmalloc space with real shadow memory" - depends on KASAN_GENERIC && HAVE_ARCH_KASAN_VMALLOC + depends on (KASAN_GENERIC || KASAN_SW_TAGS) && HAVE_ARCH_KASAN_VMALLOC help By default, the shadow region for vmalloc space is the read-only zero page. This means that KASAN cannot detect errors involving