Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3543077pxb; Mon, 24 Jan 2022 11:50:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxI3iNZpfiIrgsb0A1OSdkYefKGA1ayA9t2oaxW7+EEtafepWx+YZT1AA4jpnanBkw5rDNf X-Received: by 2002:a17:902:9a02:b0:14a:6a3:6c68 with SMTP id v2-20020a1709029a0200b0014a06a36c68mr15593090plp.138.1643053833970; Mon, 24 Jan 2022 11:50:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643053833; cv=none; d=google.com; s=arc-20160816; b=0Fpmdkfi3w7m2QIufmAnXsQdorNkoEkejen//NHObGap/l0zA5KaQablWQPxxkRKFr gu+lArN9RnJ6YxlkpKtRCt/ZVDbVmghAd0J5n7o0aWN5UBH4uwEnTNmpWhQ4hvM9hFZz BcZajsz+DujPTzUIbgqDotjb04eInKmpY7LJf8bgZoNC9pJSgLEnnkS2W9m3Vg2newGo /HkC6kI6YIgT+tbrjilo5Mh/n+Onwn3GPA0VubwnOCthvYs+iOZVobvsXsFV3oPUSL/0 w0TMd7U15/CO06y/e4VHesIWJl9h4K0y8pG6miFHeScHOyp90ayB/eBLOuSiOO8BpCfg xU8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XC1+Aytkcqzf1ileaTyJqJ/4yyuLy4mtp9hx3Zvq9co=; b=YaD1RF77SOg8MgYToFgV7U3Ib7XTmoBXGEwIPBaMQq+EXjdmTGVNvgKzeXrQdIen1K XN4bfdSo+stbJW/VWFLQLqP3jXokRMltJAhNREJAooGVeclhZa5HBwVKaSUT/TYigSYv XgbC2HPO7RvRCX1LMyKfn8BvkolHCMYcXx+X92317bJv0zw/jRoJQWkw16uheN8f6j4w XTOhNMQXl5yZO3dLT9mRePl72TCKKVaBUkJajUX+O2JrOVvCTf30mit6JPP3qQTP8gx0 iH69r4pDS5c33+DrXSWXNEzD60iXXxTOMZ5q53utL79dGKjUTaC65a/WVN3MmHlwIxg0 wYsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=liPt02iR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oc17si294598pjb.13.2022.01.24.11.50.18; Mon, 24 Jan 2022 11:50:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=liPt02iR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244602AbiAXSIh (ORCPT + 99 others); Mon, 24 Jan 2022 13:08:37 -0500 Received: from out2.migadu.com ([188.165.223.204]:15284 "EHLO out2.migadu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235662AbiAXSIc (ORCPT ); Mon, 24 Jan 2022 13:08:32 -0500 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=1643047711; 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=XC1+Aytkcqzf1ileaTyJqJ/4yyuLy4mtp9hx3Zvq9co=; b=liPt02iRnBFXDRR1MVekLfmjEXqPI0zE74mxmncZJzsGL2m2pdMXg9LmzHrwPK5jREkqe/ ebo9hFZ8whUpNBFzjwSRsc8PDTg6GjxiXszI48K3JzjnqGPL12Tpe7eKXWeEGyN0jfoiWF nY++IFUHhmz7/ghqjQ+385MLJt2mOtI= From: andrey.konovalov@linux.dev To: Andrew Morton Cc: Andrey Konovalov , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, linux-mm@kvack.org, Vincenzo Frascino , Catalin Marinas , Will Deacon , Mark Rutland , linux-arm-kernel@lists.infradead.org, Peter Collingbourne , Evgenii Stepanov , linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH v6 36/39] kasan: allow enabling KASAN_VMALLOC and SW/HW_TAGS Date: Mon, 24 Jan 2022 19:05:10 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Konovalov Allow enabling CONFIG_KASAN_VMALLOC with SW_TAGS and HW_TAGS KASAN modes. Also adjust CONFIG_KASAN_VMALLOC description: - Mention HW_TAGS support. - Remove unneeded internal details: they have no place in Kconfig description and are already explained in the documentation. Signed-off-by: Andrey Konovalov --- lib/Kconfig.kasan | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan index 879757b6dd14..1f3e620188a2 100644 --- a/lib/Kconfig.kasan +++ b/lib/Kconfig.kasan @@ -178,17 +178,17 @@ config KASAN_TAGS_IDENTIFY memory consumption. config KASAN_VMALLOC - bool "Back mappings in vmalloc space with real shadow memory" - depends on KASAN_GENERIC && HAVE_ARCH_KASAN_VMALLOC + bool "Check accesses to vmalloc allocations" + depends on 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 - vmalloc space. - - Enabling this option will hook in to vmap/vmalloc and back those - mappings with real shadow memory allocated on demand. This allows - for KASAN to detect more sorts of errors (and to support vmapped - stacks), but at the cost of higher memory usage. + This mode makes KASAN check accesses to vmalloc allocations for + validity. + + With software KASAN modes, checking is done for all types of vmalloc + allocations. Enabling this option leads to higher memory usage. + + With hardware tag-based KASAN, only VM_ALLOC mappings are checked. + There is no additional memory usage. config KASAN_KUNIT_TEST tristate "KUnit-compatible tests of KASAN bug detection capabilities" if !KUNIT_ALL_TESTS -- 2.25.1