Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp389893rdb; Thu, 21 Dec 2023 12:07:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IEhMBChoAV4L35t8opeA3bqKmUauWOrq4R7e+uxAk9g9s6VpHpCyoI8P6e9CRnhICoUQiVA X-Received: by 2002:a17:906:411a:b0:a14:b151:72e6 with SMTP id j26-20020a170906411a00b00a14b15172e6mr177531ejk.21.1703189237942; Thu, 21 Dec 2023 12:07:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703189237; cv=none; d=google.com; s=arc-20160816; b=w+Li0G2WJPm8LLhnLOauPmlp5AFaW5ol5bqDExbIzkqky1pIXbGDDAuGMio+4JhsyP BUAqXV0EGNJDzhI4iRslNVeyn9AjNfef7y2GOvkuib5ESV3hsW5+8fZhwl4qyvmFZ4ba VAvlD5ZrKAxavBMjzojV+x5kM5JFYk0JfrT+5y7jsn5Fbns0ouXiRqXNBBKGhOESKJ2F 0n1S3SWDiCtNxHgycqVBFv1rH23wfa/czUTMrFci2iuFs3n0OdX8Nkn4fhASf3i6S905 XojzGxqF12vO9zzMF56KQRHUR9betSaGpB2r4iBEIZVbl46rCY2BO/nmDfS8l63Je85u yfpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=jLiJLNrkVOviOAnhN8fsOfgjq7KcvOUpOIZZlqspNbg=; fh=GyTEpUCUNPwsl1pqA0jDPXgvja+iZTM9USlQd9sQtQg=; b=elms/IgJtoJyiaD6vypqDHJwhlY1kAUuQC4fdIOZJoNV0uHRwsx58PlkUAIxcdJfzQ /JSUS4unZigzX2pw2fduDHxTFYI0RVYDWKLkmI4piVreYVjywmvk91naHJxlJSWPmGVE /KddCkWMYSc6EUVt3EFnpi/c9RHTLGWZw7usnwtw1e4JklcSYHBjmxgfuj216IlJDwUk UzWEKXhvLjwZO1nKaO6T3Zcxeco4otXXSoBvZBZ/PSW06huhQ/BiBiJRtJ5XvIBstvi/ oLS1uYAQXuAUhDLw9LaYHA6u+QyHsYN5/N3DqhFtssPXizZB40JEtd10/VvJTRMsKB6r irPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=UstQbyfW; spf=pass (google.com: domain of linux-kernel+bounces-9029-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9029-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ka21-20020a170907921500b00a26a5f808casi823033ejb.261.2023.12.21.12.07.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 12:07:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9029-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=UstQbyfW; spf=pass (google.com: domain of linux-kernel+bounces-9029-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9029-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B1D7C1F218A3 for ; Thu, 21 Dec 2023 20:07:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A5CD876DBA; Thu, 21 Dec 2023 20:06:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="UstQbyfW" X-Original-To: linux-kernel@vger.kernel.org Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 56F8D745FC for ; Thu, 21 Dec 2023 20:06:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev 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=1703189167; 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=jLiJLNrkVOviOAnhN8fsOfgjq7KcvOUpOIZZlqspNbg=; b=UstQbyfWlazleiIZsd06p6GGsiGbF7Mk+SEC7V7KErkAUJltuZuqjmSUhenEEKoFJe2Ldb 4tUiUzH6Uvv0RFu+cj+WbPn+gOqF8clgrSf7LbqyBVZlfKgonrRaUwbKKmHlfEcXGpHP7+ mC3opDKQo6UxTJoeylICS86c/ZXC9RI= From: andrey.konovalov@linux.dev To: Marco Elver Cc: Andrey Konovalov , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH mm 11/11] kasan: speed up match_all_mem_tag test for SW_TAGS Date: Thu, 21 Dec 2023 21:04:53 +0100 Message-Id: <6fe51262defd80cdc1150c42404977aafd1b6167.1703188911.git.andreyknvl@google.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT From: Andrey Konovalov Checking all 256 possible tag values in the match_all_mem_tag KASAN test is slow and produces 256 reports. Instead, just check the first 8 and the last 8. Signed-off-by: Andrey Konovalov --- mm/kasan/kasan_test.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mm/kasan/kasan_test.c b/mm/kasan/kasan_test.c index 798df4983858..9c3a1aaab21b 100644 --- a/mm/kasan/kasan_test.c +++ b/mm/kasan/kasan_test.c @@ -1785,6 +1785,14 @@ static void match_all_mem_tag(struct kunit *test) /* For each possible tag value not matching the pointer tag. */ for (tag = KASAN_TAG_MIN; tag <= KASAN_TAG_KERNEL; tag++) { + /* + * For Software Tag-Based KASAN, skip the majority of tag + * values to avoid the test printing too many reports. + */ + if (IS_ENABLED(CONFIG_KASAN_SW_TAGS) && + tag >= KASAN_TAG_MIN + 8 && tag <= KASAN_TAG_KERNEL - 8) + continue; + if (tag == get_tag(ptr)) continue; -- 2.25.1