Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1881517pxv; Sat, 26 Jun 2021 03:12:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyahULAPM1UAzohcG/xbkMX+C/UkVUoof564YFabog6BQ/RQM/Mb9A4D//978DsM8GeehQx X-Received: by 2002:a05:6e02:1302:: with SMTP id g2mr2015539ilr.278.1624702374072; Sat, 26 Jun 2021 03:12:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624702374; cv=none; d=google.com; s=arc-20160816; b=Hh91J/1bGK0qWoMQxLSO1J+V4/SBHmuVrfZNA5D9tdbsaWVOuQn3ncYd/YcV0wHjE4 FeyXrxFjnazS7b7qll9mIpUhOgx/ydr4etXuCgtHHX/VlK99AlOc3bEIEsx4Z/Rk+Kqy 7oh/O8nQPGmviVwjdzAsI9N7VQ741FF3mnp2g12GTwVzOsDOPPN30zuoZIluZ0bPYmZh FSJRvv5fZRBTJMMA+Yylh0ZV8Yista0wUIzvrfNBI+aRAtEQW7ojb9mR4InL7M4mZXeE Nf8rvgcSzFFM7ijGtdrdvbNIADp+q/5LtswlG4ShuGgc9+2T2kn0mbE8aq0udTKeA05e 5uzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=jHJuQpSWKW8gtfeqOlelyRBRwae2YLD4g3dAcKtMdsE=; b=c4Ga6fdqzRVUKNxV3gCDkq7HdS/z7cbJdX3tJ3WYoyvVjiz9KfNeCL1a+MkxQwP05X dVkRkAzonUsBYs4B71pC1C+0TbmuTIQEsLnXQ40yw9/F1K+k2ze4URP5ziNKnkTNyEDL lO9yYYARt0FvLVwgeKCXITZa2XP43TXpO3UKQjlbc3hzYbF1vFwmBK+Z1tW5xETbwPaN mjUWs9LE9J2ew/Wuku+q90NZNxFwZhiHs5VzHrzNNAcGvT6GcLxpH/AvffBNyWKxPWHg 8rCeTQpMQWn2+Z9nLtT+l1gz/Kngm1lx1l6PBlaW5FsfRXD17SeLkBiJWcW+8VY1rAiG 8cvw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f17si9276579jaj.104.2021.06.26.03.12.42; Sat, 26 Jun 2021 03:12:54 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229954AbhFZKMG (ORCPT + 99 others); Sat, 26 Jun 2021 06:12:06 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:58718 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229586AbhFZKMC (ORCPT ); Sat, 26 Jun 2021 06:12:02 -0400 X-UUID: 18061d37e5004212a9df52c84f059005-20210626 X-UUID: 18061d37e5004212a9df52c84f059005-20210626 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2029163543; Sat, 26 Jun 2021 18:09:36 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 26 Jun 2021 18:09:35 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 26 Jun 2021 18:09:35 +0800 From: Kuan-Ying Lee To: Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Marco Elver , Dmitry Vyukov , Andrew Morton , Matthias Brugger CC: , , , , , , , , Kuan-Ying Lee Subject: [PATCH v4 1/3] kasan: rename CONFIG_KASAN_SW_TAGS_IDENTIFY to CONFIG_KASAN_TAGS_IDENTIFY Date: Sat, 26 Jun 2021 18:09:29 +0800 Message-ID: <20210626100931.22794-2-Kuan-Ying.Lee@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210626100931.22794-1-Kuan-Ying.Lee@mediatek.com> References: <20210626100931.22794-1-Kuan-Ying.Lee@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch renames CONFIG_KASAN_SW_TAGS_IDENTIFY to CONFIG_KASAN_TAGS_IDENTIFY in order to be compatible with hardware tag-based mode. Signed-off-by: Kuan-Ying Lee Suggested-by: Marco Elver Reviewed-by: Alexander Potapenko Reviewed-by: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Andrew Morton --- lib/Kconfig.kasan | 2 +- mm/kasan/kasan.h | 4 ++-- mm/kasan/report_sw_tags.c | 2 +- mm/kasan/sw_tags.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan index c3b228828a80..fdb4a08dba83 100644 --- a/lib/Kconfig.kasan +++ b/lib/Kconfig.kasan @@ -167,7 +167,7 @@ config KASAN_STACK instrumentation is also disabled as it adds inline-style instrumentation that is run unconditionally. -config KASAN_SW_TAGS_IDENTIFY +config KASAN_TAGS_IDENTIFY bool "Enable memory corruption identification" depends on KASAN_SW_TAGS help diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index 7b45b17a8106..952df2db7fdd 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -153,7 +153,7 @@ struct kasan_track { depot_stack_handle_t stack; }; -#ifdef CONFIG_KASAN_SW_TAGS_IDENTIFY +#ifdef CONFIG_KASAN_TAGS_IDENTIFY #define KASAN_NR_FREE_STACKS 5 #else #define KASAN_NR_FREE_STACKS 1 @@ -170,7 +170,7 @@ struct kasan_alloc_meta { #else struct kasan_track free_track[KASAN_NR_FREE_STACKS]; #endif -#ifdef CONFIG_KASAN_SW_TAGS_IDENTIFY +#ifdef CONFIG_KASAN_TAGS_IDENTIFY u8 free_pointer_tag[KASAN_NR_FREE_STACKS]; u8 free_track_idx; #endif diff --git a/mm/kasan/report_sw_tags.c b/mm/kasan/report_sw_tags.c index 3d20d3451d9e..821a14a19a92 100644 --- a/mm/kasan/report_sw_tags.c +++ b/mm/kasan/report_sw_tags.c @@ -31,7 +31,7 @@ const char *kasan_get_bug_type(struct kasan_access_info *info) { -#ifdef CONFIG_KASAN_SW_TAGS_IDENTIFY +#ifdef CONFIG_KASAN_TAGS_IDENTIFY struct kasan_alloc_meta *alloc_meta; struct kmem_cache *cache; struct page *page; diff --git a/mm/kasan/sw_tags.c b/mm/kasan/sw_tags.c index 9362938abbfa..dd05e6c801fa 100644 --- a/mm/kasan/sw_tags.c +++ b/mm/kasan/sw_tags.c @@ -177,7 +177,7 @@ void kasan_set_free_info(struct kmem_cache *cache, if (!alloc_meta) return; -#ifdef CONFIG_KASAN_SW_TAGS_IDENTIFY +#ifdef CONFIG_KASAN_TAGS_IDENTIFY idx = alloc_meta->free_track_idx; alloc_meta->free_pointer_tag[idx] = tag; alloc_meta->free_track_idx = (idx + 1) % KASAN_NR_FREE_STACKS; @@ -196,7 +196,7 @@ struct kasan_track *kasan_get_free_track(struct kmem_cache *cache, if (!alloc_meta) return NULL; -#ifdef CONFIG_KASAN_SW_TAGS_IDENTIFY +#ifdef CONFIG_KASAN_TAGS_IDENTIFY for (i = 0; i < KASAN_NR_FREE_STACKS; i++) { if (alloc_meta->free_pointer_tag[i] == tag) break; -- 2.18.0