All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: vincenzo.frascino@arm.com,ryabinin.a.a@gmail.com,glider@google.com,elver@google.com,dvyukov@google.com,catalin.marinas@arm.com,andreyknvl@google.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org
Subject: [patch 069/114] kasan: test: support async (again) and asymm modes for HW_TAGS
Date: Thu, 24 Mar 2022 18:12:02 -0700	[thread overview]
Message-ID: <20220325011202.F275DC340F3@smtp.kernel.org> (raw)
In-Reply-To: <20220324180758.96b1ac7e17675d6bc474485e@linux-foundation.org>

From: Andrey Konovalov <andreyknvl@google.com>
Subject: kasan: test: support async (again) and asymm modes for HW_TAGS

Async mode support has already been implemented in commit e80a76aa1a91
("kasan, arm64: tests supports for HW_TAGS async mode") but then got
accidentally broken in commit 99734b535d9b ("kasan: detect false-positives
in tests").

Restore the changes removed by the latter patch and adapt them for asymm
mode: add a sync_fault flag to kunit_kasan_expectation that only get set
if the MTE fault was synchronous, and reenable MTE on such faults in
tests.

Also rename kunit_kasan_expectation to kunit_kasan_status and move its
definition to mm/kasan/kasan.h from include/linux/kasan.h, as this
structure is only internally used by KASAN.  Also put the structure
definition under IS_ENABLED(CONFIG_KUNIT).

Link: https://lkml.kernel.org/r/133970562ccacc93ba19d754012c562351d4a8c8.1645033139.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Cc: Marco Elver <elver@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/kasan.h |    5 -----
 lib/test_kasan.c      |   39 ++++++++++++++++++++++-----------------
 mm/kasan/hw_tags.c    |   18 +++++++++---------
 mm/kasan/kasan.h      |   14 ++++++++++++--
 mm/kasan/report.c     |   17 +++++++++--------
 5 files changed, 52 insertions(+), 41 deletions(-)

--- a/include/linux/kasan.h~kasan-test-support-async-again-and-asymm-modes-for-hw_tags
+++ a/include/linux/kasan.h
@@ -19,11 +19,6 @@ struct task_struct;
 #include <linux/linkage.h>
 #include <asm/kasan.h>
 
-/* kasan_data struct is used in KUnit tests for KASAN expected failures */
-struct kunit_kasan_expectation {
-	bool report_found;
-};
-
 #endif
 
 typedef unsigned int __bitwise kasan_vmalloc_flags_t;
--- a/lib/test_kasan.c~kasan-test-support-async-again-and-asymm-modes-for-hw_tags
+++ a/lib/test_kasan.c
@@ -37,7 +37,7 @@ void *kasan_ptr_result;
 int kasan_int_result;
 
 static struct kunit_resource resource;
-static struct kunit_kasan_expectation fail_data;
+static struct kunit_kasan_status test_status;
 static bool multishot;
 
 /*
@@ -54,58 +54,63 @@ static int kasan_test_init(struct kunit
 	}
 
 	multishot = kasan_save_enable_multi_shot();
-	fail_data.report_found = false;
+	test_status.report_found = false;
+	test_status.sync_fault = false;
 	kunit_add_named_resource(test, NULL, NULL, &resource,
-					"kasan_data", &fail_data);
+					"kasan_status", &test_status);
 	return 0;
 }
 
 static void kasan_test_exit(struct kunit *test)
 {
 	kasan_restore_multi_shot(multishot);
-	KUNIT_EXPECT_FALSE(test, fail_data.report_found);
+	KUNIT_EXPECT_FALSE(test, test_status.report_found);
 }
 
 /**
  * KUNIT_EXPECT_KASAN_FAIL() - check that the executed expression produces a
  * KASAN report; causes a test failure otherwise. This relies on a KUnit
- * resource named "kasan_data". Do not use this name for KUnit resources
+ * resource named "kasan_status". Do not use this name for KUnit resources
  * outside of KASAN tests.
  *
- * For hardware tag-based KASAN in sync mode, when a tag fault happens, tag
+ * For hardware tag-based KASAN, when a synchronous tag fault happens, tag
  * checking is auto-disabled. When this happens, this test handler reenables
  * tag checking. As tag checking can be only disabled or enabled per CPU,
  * this handler disables migration (preemption).
  *
- * Since the compiler doesn't see that the expression can change the fail_data
+ * Since the compiler doesn't see that the expression can change the test_status
  * fields, it can reorder or optimize away the accesses to those fields.
  * Use READ/WRITE_ONCE() for the accesses and compiler barriers around the
  * expression to prevent that.
  *
- * In between KUNIT_EXPECT_KASAN_FAIL checks, fail_data.report_found is kept as
- * false. This allows detecting KASAN reports that happen outside of the checks
- * by asserting !fail_data.report_found at the start of KUNIT_EXPECT_KASAN_FAIL
- * and in kasan_test_exit.
+ * In between KUNIT_EXPECT_KASAN_FAIL checks, test_status.report_found is kept
+ * as false. This allows detecting KASAN reports that happen outside of the
+ * checks by asserting !test_status.report_found at the start of
+ * KUNIT_EXPECT_KASAN_FAIL and in kasan_test_exit.
  */
 #define KUNIT_EXPECT_KASAN_FAIL(test, expression) do {			\
 	if (IS_ENABLED(CONFIG_KASAN_HW_TAGS) &&				\
 	    kasan_sync_fault_possible())				\
 		migrate_disable();					\
-	KUNIT_EXPECT_FALSE(test, READ_ONCE(fail_data.report_found));	\
+	KUNIT_EXPECT_FALSE(test, READ_ONCE(test_status.report_found));	\
 	barrier();							\
 	expression;							\
 	barrier();							\
-	if (!READ_ONCE(fail_data.report_found)) {			\
+	if (kasan_async_fault_possible())				\
+		kasan_force_async_fault();				\
+	if (!READ_ONCE(test_status.report_found)) {			\
 		KUNIT_FAIL(test, KUNIT_SUBTEST_INDENT "KASAN failure "	\
 				"expected in \"" #expression		\
 				 "\", but none occurred");		\
 	}								\
-	if (IS_ENABLED(CONFIG_KASAN_HW_TAGS)) {				\
-		if (READ_ONCE(fail_data.report_found))			\
-			kasan_enable_tagging_sync();			\
+	if (IS_ENABLED(CONFIG_KASAN_HW_TAGS) &&				\
+	    kasan_sync_fault_possible()) {				\
+		if (READ_ONCE(test_status.report_found) &&		\
+		    READ_ONCE(test_status.sync_fault))			\
+			kasan_enable_tagging();				\
 		migrate_enable();					\
 	}								\
-	WRITE_ONCE(fail_data.report_found, false);			\
+	WRITE_ONCE(test_status.report_found, false);			\
 } while (0)
 
 #define KASAN_TEST_NEEDS_CONFIG_ON(test, config) do {			\
--- a/mm/kasan/hw_tags.c~kasan-test-support-async-again-and-asymm-modes-for-hw_tags
+++ a/mm/kasan/hw_tags.c
@@ -172,12 +172,7 @@ void kasan_init_hw_tags_cpu(void)
 	 * Enable async or asymm modes only when explicitly requested
 	 * through the command line.
 	 */
-	if (kasan_arg_mode == KASAN_ARG_MODE_ASYNC)
-		hw_enable_tagging_async();
-	else if (kasan_arg_mode == KASAN_ARG_MODE_ASYMM)
-		hw_enable_tagging_asymm();
-	else
-		hw_enable_tagging_sync();
+	kasan_enable_tagging();
 }
 
 /* kasan_init_hw_tags() is called once on boot CPU. */
@@ -343,11 +338,16 @@ void __kasan_poison_vmalloc(const void *
 
 #if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST)
 
-void kasan_enable_tagging_sync(void)
+void kasan_enable_tagging(void)
 {
-	hw_enable_tagging_sync();
+	if (kasan_arg_mode == KASAN_ARG_MODE_ASYNC)
+		hw_enable_tagging_async();
+	else if (kasan_arg_mode == KASAN_ARG_MODE_ASYMM)
+		hw_enable_tagging_asymm();
+	else
+		hw_enable_tagging_sync();
 }
-EXPORT_SYMBOL_GPL(kasan_enable_tagging_sync);
+EXPORT_SYMBOL_GPL(kasan_enable_tagging);
 
 void kasan_force_async_fault(void)
 {
--- a/mm/kasan/kasan.h~kasan-test-support-async-again-and-asymm-modes-for-hw_tags
+++ a/mm/kasan/kasan.h
@@ -7,6 +7,16 @@
 #include <linux/kfence.h>
 #include <linux/stackdepot.h>
 
+#if IS_ENABLED(CONFIG_KUNIT)
+
+/* Used in KUnit-compatible KASAN tests. */
+struct kunit_kasan_status {
+	bool report_found;
+	bool sync_fault;
+};
+
+#endif
+
 #ifdef CONFIG_KASAN_HW_TAGS
 
 #include <linux/static_key.h>
@@ -350,12 +360,12 @@ static inline const void *arch_kasan_set
 
 #if defined(CONFIG_KASAN_HW_TAGS) && IS_ENABLED(CONFIG_KASAN_KUNIT_TEST)
 
-void kasan_enable_tagging_sync(void);
+void kasan_enable_tagging(void);
 void kasan_force_async_fault(void);
 
 #else /* CONFIG_KASAN_HW_TAGS || CONFIG_KASAN_KUNIT_TEST */
 
-static inline void kasan_enable_tagging_sync(void) { }
+static inline void kasan_enable_tagging(void) { }
 static inline void kasan_force_async_fault(void) { }
 
 #endif /* CONFIG_KASAN_HW_TAGS || CONFIG_KASAN_KUNIT_TEST */
--- a/mm/kasan/report.c~kasan-test-support-async-again-and-asymm-modes-for-hw_tags
+++ a/mm/kasan/report.c
@@ -336,20 +336,21 @@ static bool report_enabled(void)
 }
 
 #if IS_ENABLED(CONFIG_KUNIT)
-static void kasan_update_kunit_status(struct kunit *cur_test)
+static void kasan_update_kunit_status(struct kunit *cur_test, bool sync)
 {
 	struct kunit_resource *resource;
-	struct kunit_kasan_expectation *kasan_data;
+	struct kunit_kasan_status *status;
 
-	resource = kunit_find_named_resource(cur_test, "kasan_data");
+	resource = kunit_find_named_resource(cur_test, "kasan_status");
 
 	if (!resource) {
 		kunit_set_failure(cur_test);
 		return;
 	}
 
-	kasan_data = (struct kunit_kasan_expectation *)resource->data;
-	WRITE_ONCE(kasan_data->report_found, true);
+	status = (struct kunit_kasan_status *)resource->data;
+	WRITE_ONCE(status->report_found, true);
+	WRITE_ONCE(status->sync_fault, sync);
 	kunit_put_resource(resource);
 }
 #endif /* IS_ENABLED(CONFIG_KUNIT) */
@@ -363,7 +364,7 @@ void kasan_report_invalid_free(void *obj
 
 #if IS_ENABLED(CONFIG_KUNIT)
 	if (current->kunit_test)
-		kasan_update_kunit_status(current->kunit_test);
+		kasan_update_kunit_status(current->kunit_test, true);
 #endif /* IS_ENABLED(CONFIG_KUNIT) */
 
 	start_report(&flags);
@@ -383,7 +384,7 @@ void kasan_report_async(void)
 
 #if IS_ENABLED(CONFIG_KUNIT)
 	if (current->kunit_test)
-		kasan_update_kunit_status(current->kunit_test);
+		kasan_update_kunit_status(current->kunit_test, false);
 #endif /* IS_ENABLED(CONFIG_KUNIT) */
 
 	start_report(&flags);
@@ -405,7 +406,7 @@ static void __kasan_report(unsigned long
 
 #if IS_ENABLED(CONFIG_KUNIT)
 	if (current->kunit_test)
-		kasan_update_kunit_status(current->kunit_test);
+		kasan_update_kunit_status(current->kunit_test, true);
 #endif /* IS_ENABLED(CONFIG_KUNIT) */
 
 	disable_trace_on_warning();
_

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: vincenzo.frascino@arm.com, ryabinin.a.a@gmail.com,
	glider@google.com, elver@google.com, dvyukov@google.com,
	catalin.marinas@arm.com, andreyknvl@google.com,
	akpm@linux-foundation.org, patches@lists.linux.dev,
	linux-mm@kvack.org, mm-commits@vger.kernel.org,
	torvalds@linux-foundation.org, akpm@linux-foundation.org
Subject: [patch 069/114] kasan: test: support async (again) and asymm modes for HW_TAGS
Date: Thu, 24 Mar 2022 18:12:02 -0700	[thread overview]
Message-ID: <20220325011202.F275DC340F3@smtp.kernel.org> (raw)
In-Reply-To: <20220324180758.96b1ac7e17675d6bc474485e@linux-foundation.org>

From: Andrey Konovalov <andreyknvl@google.com>
Subject: kasan: test: support async (again) and asymm modes for HW_TAGS

Async mode support has already been implemented in commit e80a76aa1a91
("kasan, arm64: tests supports for HW_TAGS async mode") but then got
accidentally broken in commit 99734b535d9b ("kasan: detect false-positives
in tests").

Restore the changes removed by the latter patch and adapt them for asymm
mode: add a sync_fault flag to kunit_kasan_expectation that only get set
if the MTE fault was synchronous, and reenable MTE on such faults in
tests.

Also rename kunit_kasan_expectation to kunit_kasan_status and move its
definition to mm/kasan/kasan.h from include/linux/kasan.h, as this
structure is only internally used by KASAN.  Also put the structure
definition under IS_ENABLED(CONFIG_KUNIT).

Link: https://lkml.kernel.org/r/133970562ccacc93ba19d754012c562351d4a8c8.1645033139.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Cc: Marco Elver <elver@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/kasan.h |    5 -----
 lib/test_kasan.c      |   39 ++++++++++++++++++++++-----------------
 mm/kasan/hw_tags.c    |   18 +++++++++---------
 mm/kasan/kasan.h      |   14 ++++++++++++--
 mm/kasan/report.c     |   17 +++++++++--------
 5 files changed, 52 insertions(+), 41 deletions(-)

--- a/include/linux/kasan.h~kasan-test-support-async-again-and-asymm-modes-for-hw_tags
+++ a/include/linux/kasan.h
@@ -19,11 +19,6 @@ struct task_struct;
 #include <linux/linkage.h>
 #include <asm/kasan.h>
 
-/* kasan_data struct is used in KUnit tests for KASAN expected failures */
-struct kunit_kasan_expectation {
-	bool report_found;
-};
-
 #endif
 
 typedef unsigned int __bitwise kasan_vmalloc_flags_t;
--- a/lib/test_kasan.c~kasan-test-support-async-again-and-asymm-modes-for-hw_tags
+++ a/lib/test_kasan.c
@@ -37,7 +37,7 @@ void *kasan_ptr_result;
 int kasan_int_result;
 
 static struct kunit_resource resource;
-static struct kunit_kasan_expectation fail_data;
+static struct kunit_kasan_status test_status;
 static bool multishot;
 
 /*
@@ -54,58 +54,63 @@ static int kasan_test_init(struct kunit
 	}
 
 	multishot = kasan_save_enable_multi_shot();
-	fail_data.report_found = false;
+	test_status.report_found = false;
+	test_status.sync_fault = false;
 	kunit_add_named_resource(test, NULL, NULL, &resource,
-					"kasan_data", &fail_data);
+					"kasan_status", &test_status);
 	return 0;
 }
 
 static void kasan_test_exit(struct kunit *test)
 {
 	kasan_restore_multi_shot(multishot);
-	KUNIT_EXPECT_FALSE(test, fail_data.report_found);
+	KUNIT_EXPECT_FALSE(test, test_status.report_found);
 }
 
 /**
  * KUNIT_EXPECT_KASAN_FAIL() - check that the executed expression produces a
  * KASAN report; causes a test failure otherwise. This relies on a KUnit
- * resource named "kasan_data". Do not use this name for KUnit resources
+ * resource named "kasan_status". Do not use this name for KUnit resources
  * outside of KASAN tests.
  *
- * For hardware tag-based KASAN in sync mode, when a tag fault happens, tag
+ * For hardware tag-based KASAN, when a synchronous tag fault happens, tag
  * checking is auto-disabled. When this happens, this test handler reenables
  * tag checking. As tag checking can be only disabled or enabled per CPU,
  * this handler disables migration (preemption).
  *
- * Since the compiler doesn't see that the expression can change the fail_data
+ * Since the compiler doesn't see that the expression can change the test_status
  * fields, it can reorder or optimize away the accesses to those fields.
  * Use READ/WRITE_ONCE() for the accesses and compiler barriers around the
  * expression to prevent that.
  *
- * In between KUNIT_EXPECT_KASAN_FAIL checks, fail_data.report_found is kept as
- * false. This allows detecting KASAN reports that happen outside of the checks
- * by asserting !fail_data.report_found at the start of KUNIT_EXPECT_KASAN_FAIL
- * and in kasan_test_exit.
+ * In between KUNIT_EXPECT_KASAN_FAIL checks, test_status.report_found is kept
+ * as false. This allows detecting KASAN reports that happen outside of the
+ * checks by asserting !test_status.report_found at the start of
+ * KUNIT_EXPECT_KASAN_FAIL and in kasan_test_exit.
  */
 #define KUNIT_EXPECT_KASAN_FAIL(test, expression) do {			\
 	if (IS_ENABLED(CONFIG_KASAN_HW_TAGS) &&				\
 	    kasan_sync_fault_possible())				\
 		migrate_disable();					\
-	KUNIT_EXPECT_FALSE(test, READ_ONCE(fail_data.report_found));	\
+	KUNIT_EXPECT_FALSE(test, READ_ONCE(test_status.report_found));	\
 	barrier();							\
 	expression;							\
 	barrier();							\
-	if (!READ_ONCE(fail_data.report_found)) {			\
+	if (kasan_async_fault_possible())				\
+		kasan_force_async_fault();				\
+	if (!READ_ONCE(test_status.report_found)) {			\
 		KUNIT_FAIL(test, KUNIT_SUBTEST_INDENT "KASAN failure "	\
 				"expected in \"" #expression		\
 				 "\", but none occurred");		\
 	}								\
-	if (IS_ENABLED(CONFIG_KASAN_HW_TAGS)) {				\
-		if (READ_ONCE(fail_data.report_found))			\
-			kasan_enable_tagging_sync();			\
+	if (IS_ENABLED(CONFIG_KASAN_HW_TAGS) &&				\
+	    kasan_sync_fault_possible()) {				\
+		if (READ_ONCE(test_status.report_found) &&		\
+		    READ_ONCE(test_status.sync_fault))			\
+			kasan_enable_tagging();				\
 		migrate_enable();					\
 	}								\
-	WRITE_ONCE(fail_data.report_found, false);			\
+	WRITE_ONCE(test_status.report_found, false);			\
 } while (0)
 
 #define KASAN_TEST_NEEDS_CONFIG_ON(test, config) do {			\
--- a/mm/kasan/hw_tags.c~kasan-test-support-async-again-and-asymm-modes-for-hw_tags
+++ a/mm/kasan/hw_tags.c
@@ -172,12 +172,7 @@ void kasan_init_hw_tags_cpu(void)
 	 * Enable async or asymm modes only when explicitly requested
 	 * through the command line.
 	 */
-	if (kasan_arg_mode == KASAN_ARG_MODE_ASYNC)
-		hw_enable_tagging_async();
-	else if (kasan_arg_mode == KASAN_ARG_MODE_ASYMM)
-		hw_enable_tagging_asymm();
-	else
-		hw_enable_tagging_sync();
+	kasan_enable_tagging();
 }
 
 /* kasan_init_hw_tags() is called once on boot CPU. */
@@ -343,11 +338,16 @@ void __kasan_poison_vmalloc(const void *
 
 #if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST)
 
-void kasan_enable_tagging_sync(void)
+void kasan_enable_tagging(void)
 {
-	hw_enable_tagging_sync();
+	if (kasan_arg_mode == KASAN_ARG_MODE_ASYNC)
+		hw_enable_tagging_async();
+	else if (kasan_arg_mode == KASAN_ARG_MODE_ASYMM)
+		hw_enable_tagging_asymm();
+	else
+		hw_enable_tagging_sync();
 }
-EXPORT_SYMBOL_GPL(kasan_enable_tagging_sync);
+EXPORT_SYMBOL_GPL(kasan_enable_tagging);
 
 void kasan_force_async_fault(void)
 {
--- a/mm/kasan/kasan.h~kasan-test-support-async-again-and-asymm-modes-for-hw_tags
+++ a/mm/kasan/kasan.h
@@ -7,6 +7,16 @@
 #include <linux/kfence.h>
 #include <linux/stackdepot.h>
 
+#if IS_ENABLED(CONFIG_KUNIT)
+
+/* Used in KUnit-compatible KASAN tests. */
+struct kunit_kasan_status {
+	bool report_found;
+	bool sync_fault;
+};
+
+#endif
+
 #ifdef CONFIG_KASAN_HW_TAGS
 
 #include <linux/static_key.h>
@@ -350,12 +360,12 @@ static inline const void *arch_kasan_set
 
 #if defined(CONFIG_KASAN_HW_TAGS) && IS_ENABLED(CONFIG_KASAN_KUNIT_TEST)
 
-void kasan_enable_tagging_sync(void);
+void kasan_enable_tagging(void);
 void kasan_force_async_fault(void);
 
 #else /* CONFIG_KASAN_HW_TAGS || CONFIG_KASAN_KUNIT_TEST */
 
-static inline void kasan_enable_tagging_sync(void) { }
+static inline void kasan_enable_tagging(void) { }
 static inline void kasan_force_async_fault(void) { }
 
 #endif /* CONFIG_KASAN_HW_TAGS || CONFIG_KASAN_KUNIT_TEST */
--- a/mm/kasan/report.c~kasan-test-support-async-again-and-asymm-modes-for-hw_tags
+++ a/mm/kasan/report.c
@@ -336,20 +336,21 @@ static bool report_enabled(void)
 }
 
 #if IS_ENABLED(CONFIG_KUNIT)
-static void kasan_update_kunit_status(struct kunit *cur_test)
+static void kasan_update_kunit_status(struct kunit *cur_test, bool sync)
 {
 	struct kunit_resource *resource;
-	struct kunit_kasan_expectation *kasan_data;
+	struct kunit_kasan_status *status;
 
-	resource = kunit_find_named_resource(cur_test, "kasan_data");
+	resource = kunit_find_named_resource(cur_test, "kasan_status");
 
 	if (!resource) {
 		kunit_set_failure(cur_test);
 		return;
 	}
 
-	kasan_data = (struct kunit_kasan_expectation *)resource->data;
-	WRITE_ONCE(kasan_data->report_found, true);
+	status = (struct kunit_kasan_status *)resource->data;
+	WRITE_ONCE(status->report_found, true);
+	WRITE_ONCE(status->sync_fault, sync);
 	kunit_put_resource(resource);
 }
 #endif /* IS_ENABLED(CONFIG_KUNIT) */
@@ -363,7 +364,7 @@ void kasan_report_invalid_free(void *obj
 
 #if IS_ENABLED(CONFIG_KUNIT)
 	if (current->kunit_test)
-		kasan_update_kunit_status(current->kunit_test);
+		kasan_update_kunit_status(current->kunit_test, true);
 #endif /* IS_ENABLED(CONFIG_KUNIT) */
 
 	start_report(&flags);
@@ -383,7 +384,7 @@ void kasan_report_async(void)
 
 #if IS_ENABLED(CONFIG_KUNIT)
 	if (current->kunit_test)
-		kasan_update_kunit_status(current->kunit_test);
+		kasan_update_kunit_status(current->kunit_test, false);
 #endif /* IS_ENABLED(CONFIG_KUNIT) */
 
 	start_report(&flags);
@@ -405,7 +406,7 @@ static void __kasan_report(unsigned long
 
 #if IS_ENABLED(CONFIG_KUNIT)
 	if (current->kunit_test)
-		kasan_update_kunit_status(current->kunit_test);
+		kasan_update_kunit_status(current->kunit_test, true);
 #endif /* IS_ENABLED(CONFIG_KUNIT) */
 
 	disable_trace_on_warning();
_

  parent reply	other threads:[~2022-03-25  1:12 UTC|newest]

Thread overview: 229+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25  1:07 incoming Andrew Morton
2022-03-25  1:08 ` [patch 001/114] tools/vm/page_owner_sort.c: sort by stacktrace before culling Andrew Morton
2022-03-25  1:08   ` Andrew Morton
2022-03-25  1:08 ` [patch 002/114] tools/vm/page_owner_sort.c: support sorting by stack trace Andrew Morton
2022-03-25  1:08   ` Andrew Morton
2022-03-25  1:08 ` [patch 003/114] tools/vm/page_owner_sort.c: add switch between culling by stacktrace and txt Andrew Morton
2022-03-25  1:08   ` Andrew Morton
2022-03-25  1:08 ` [patch 004/114] tools/vm/page_owner_sort.c: support sorting pid and time Andrew Morton
2022-03-25  1:08   ` Andrew Morton
2022-03-25  1:08 ` [patch 005/114] tools/vm/page_owner_sort.c: two trivial fixes Andrew Morton
2022-03-25  1:08   ` Andrew Morton
2022-03-25  1:08 ` [patch 006/114] tools/vm/page_owner_sort.c: delete invalid duplicate code Andrew Morton
2022-03-25  1:08   ` Andrew Morton
2022-03-25  1:08 ` [patch 007/114] Documentation/vm/page_owner.rst: update the documentation Andrew Morton
2022-03-25  1:08   ` Andrew Morton
2022-03-25  1:08 ` [patch 008/114] Documentation/vm/page_owner.rst: fix unexpected indentation warns Andrew Morton
2022-03-25  1:08   ` Andrew Morton
2022-03-25  1:09 ` [patch 009/114] lib/vsprintf: avoid redundant work with 0 size Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:09 ` [patch 010/114] mm/page_owner: use scnprintf() to avoid excessive buffer overrun check Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:09 ` [patch 011/114] mm/page_owner: print memcg information Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:09 ` [patch 012/114] mm/page_owner: record task command name Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:09 ` [patch 013/114] mm/page_owner.c: record tgid Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:09 ` [patch 014/114] tools/vm/page_owner_sort.c: fix the instructions for use Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:09 ` [patch 015/114] tools/vm/page_owner_sort.c: fix comments Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:09 ` [patch 016/114] tools/vm/page_owner_sort.c: add a security check Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:09 ` [patch 017/114] tools/vm/page_owner_sort.c: support sorting by tgid and update documentation Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:09 ` [patch 018/114] tools/vm/page_owner_sort: fix three trivival places Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:09 ` [patch 019/114] tools/vm/page_owner_sort: support for sorting by task command name Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:09 ` [patch 020/114] tools/vm/page_owner_sort.c: support for selecting by PID, TGID or " Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:09 ` [patch 021/114] tools/vm/page_owner_sort.c: support for user-defined culling rules Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:09 ` [patch 022/114] mm: unexport page_init_poison Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:09 ` [patch 023/114] selftest/vm: add util.h and and move helper functions there Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:09 ` [patch 024/114] selftest/vm: add helpers to detect PAGE_SIZE and PAGE_SHIFT Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:09 ` [patch 025/114] mm: delete __ClearPageWaiters() Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:09 ` [patch 026/114] mm: filemap_unaccount_folio() large skip mapcount fixup Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:09 ` [patch 027/114] mm/thp: fix NR_FILE_MAPPED accounting in page_*_file_rmap() Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:09 ` [patch 028/114] mm/migration: add trace events for THP migrations Andrew Morton
2022-03-25  1:09   ` Andrew Morton
2022-03-25  1:10 ` [patch 029/114] mm/migration: add trace events for base page and HugeTLB migrations Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:10 ` [patch 030/114] kasan, page_alloc: deduplicate should_skip_kasan_poison Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:10 ` [patch 031/114] kasan, page_alloc: move tag_clear_highpage out of kernel_init_free_pages Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:10 ` [patch 032/114] kasan, page_alloc: merge kasan_free_pages into free_pages_prepare Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:10 ` [patch 033/114] kasan, page_alloc: simplify kasan_poison_pages call site Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:10 ` [patch 034/114] kasan, page_alloc: init memory of skipped pages on free Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:10 ` [patch 035/114] kasan: drop skip_kasan_poison variable in free_pages_prepare Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:10 ` [patch 036/114] mm: clarify __GFP_ZEROTAGS comment Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:10 ` [patch 037/114] kasan: only apply __GFP_ZEROTAGS when memory is zeroed Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:10 ` [patch 038/114] kasan, page_alloc: refactor init checks in post_alloc_hook Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:10 ` [patch 039/114] kasan, page_alloc: merge kasan_alloc_pages into post_alloc_hook Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:10 ` [patch 040/114] kasan, page_alloc: combine tag_clear_highpage calls in post_alloc_hook Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:10 ` [patch 041/114] kasan, page_alloc: move SetPageSkipKASanPoison " Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:10 ` [patch 042/114] kasan, page_alloc: move kernel_init_free_pages " Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:10 ` [patch 043/114] kasan, page_alloc: rework kasan_unpoison_pages call site Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:10 ` [patch 044/114] kasan: clean up metadata byte definitions Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:10 ` [patch 045/114] kasan: define KASAN_VMALLOC_INVALID for SW_TAGS Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:10 ` [patch 046/114] kasan, x86, arm64, s390: rename functions for modules shadow Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:10 ` [patch 047/114] kasan, vmalloc: drop outdated VM_KASAN comment Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:10 ` [patch 048/114] kasan: reorder vmalloc hooks Andrew Morton
2022-03-25  1:10   ` Andrew Morton
2022-03-25  1:11 ` [patch 049/114] kasan: add wrappers for " Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:11 ` [patch 050/114] kasan, vmalloc: reset tags in vmalloc functions Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:11 ` [patch 051/114] kasan, fork: reset pointer tags of vmapped stacks Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:11 ` [patch 052/114] kasan, arm64: " Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:11 ` [patch 053/114] kasan, vmalloc: add vmalloc tagging for SW_TAGS Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:11 ` [patch 054/114] kasan, vmalloc, arm64: mark vmalloc mappings as pgprot_tagged Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:11 ` [patch 055/114] kasan, vmalloc: unpoison VM_ALLOC pages after mapping Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:11 ` [patch 056/114] kasan, mm: only define ___GFP_SKIP_KASAN_POISON with HW_TAGS Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:11 ` [patch 057/114] kasan, page_alloc: allow skipping unpoisoning for HW_TAGS Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:11 ` [patch 058/114] kasan, page_alloc: allow skipping memory init " Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:11 ` [patch 059/114] kasan, vmalloc: add vmalloc tagging " Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:11 ` [patch 060/114] kasan, vmalloc: only tag normal vmalloc allocations Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:11 ` [patch 061/114] kasan, arm64: don't tag executable " Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:11 ` [patch 062/114] kasan: mark kasan_arg_stacktrace as __initdata Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:11 ` [patch 063/114] kasan: clean up feature flags for HW_TAGS mode Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:11 ` [patch 064/114] kasan: add kasan.vmalloc command line flag Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:11 ` [patch 065/114] kasan: allow enabling KASAN_VMALLOC and SW/HW_TAGS Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:11 ` [patch 066/114] arm64: select KASAN_VMALLOC for SW/HW_TAGS modes Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:11 ` [patch 067/114] kasan: documentation updates Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:11 ` [patch 068/114] kasan: improve vmalloc tests Andrew Morton
2022-03-25  1:11   ` Andrew Morton
2022-03-25  1:12 ` Andrew Morton [this message]
2022-03-25  1:12   ` [patch 069/114] kasan: test: support async (again) and asymm modes for HW_TAGS Andrew Morton
2022-03-25  1:12 ` [patch 070/114] mm/kasan: remove unnecessary CONFIG_KASAN option Andrew Morton
2022-03-25  1:12   ` Andrew Morton
2022-03-25  1:12 ` [patch 071/114] kasan: update function name in comments Andrew Morton
2022-03-25  1:12   ` Andrew Morton
2022-03-25  1:12 ` [patch 072/114] kasan: print virtual mapping info in reports Andrew Morton
2022-03-25  1:12   ` Andrew Morton
2022-03-25  1:12 ` [patch 073/114] kasan: drop addr check from describe_object_addr Andrew Morton
2022-03-25  1:12   ` Andrew Morton
2022-03-25  1:12 ` [patch 074/114] kasan: more line breaks in reports Andrew Morton
2022-03-25  1:12   ` Andrew Morton
2022-03-25  1:12 ` [patch 075/114] kasan: rearrange stack frame info " Andrew Morton
2022-03-25  1:12   ` Andrew Morton
2022-03-25  1:12 ` [patch 076/114] kasan: improve " Andrew Morton
2022-03-25  1:12   ` Andrew Morton
2022-03-25  1:12 ` [patch 077/114] kasan: print basic stack frame info for SW_TAGS Andrew Morton
2022-03-25  1:12   ` Andrew Morton
2022-03-25  1:12 ` [patch 078/114] kasan: simplify async check in end_report() Andrew Morton
2022-03-25  1:12   ` Andrew Morton
2022-03-25  1:12 ` [patch 079/114] kasan: simplify kasan_update_kunit_status() and call sites Andrew Morton
2022-03-25  1:12   ` Andrew Morton
2022-03-25  1:12 ` [patch 080/114] kasan: check CONFIG_KASAN_KUNIT_TEST instead of CONFIG_KUNIT Andrew Morton
2022-03-25  1:12   ` Andrew Morton
2022-03-25  1:12 ` [patch 081/114] kasan: move update_kunit_status to start_report Andrew Morton
2022-03-25  1:12   ` Andrew Morton
2022-03-25  1:12 ` [patch 082/114] kasan: move disable_trace_on_warning " Andrew Morton
2022-03-25  1:12   ` Andrew Morton
2022-03-25  1:12 ` [patch 083/114] kasan: split out print_report from __kasan_report Andrew Morton
2022-03-25  1:12   ` Andrew Morton
2022-03-25  1:12 ` [patch 084/114] kasan: simplify kasan_find_first_bad_addr call sites Andrew Morton
2022-03-25  1:12   ` Andrew Morton
2022-03-25  1:12 ` [patch 085/114] kasan: restructure kasan_report Andrew Morton
2022-03-25  1:12   ` Andrew Morton
2022-03-25  1:12 ` [patch 086/114] kasan: merge __kasan_report into kasan_report Andrew Morton
2022-03-25  1:12   ` Andrew Morton
2022-03-25  1:12 ` [patch 087/114] kasan: call print_report from kasan_report_invalid_free Andrew Morton
2022-03-25  1:12   ` Andrew Morton
2022-03-25  1:12 ` [patch 088/114] kasan: move and simplify kasan_report_async Andrew Morton
2022-03-25  1:12   ` Andrew Morton
2022-03-25  1:13 ` [patch 089/114] kasan: rename kasan_access_info to kasan_report_info Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:13 ` [patch 090/114] kasan: add comment about UACCESS regions to kasan_report Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:13 ` [patch 091/114] kasan: respect KASAN_BIT_REPORTED in all reporting routines Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:13 ` [patch 092/114] kasan: reorder reporting functions Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:13 ` [patch 093/114] kasan: move and hide kasan_save_enable/restore_multi_shot Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:13 ` [patch 094/114] kasan: disable LOCKDEP when printing reports Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:13 ` [patch 095/114] mm: enable MADV_DONTNEED for hugetlb mappings Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:13 ` [patch 096/114] selftests/vm: add hugetlb madvise MADV_DONTNEED MADV_REMOVE test Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:13 ` [patch 097/114] userfaultfd/selftests: enable hugetlb remap and remove event testing Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:13 ` [patch 098/114] mm/huge_memory: make is_transparent_hugepage() static Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:13 ` [patch 099/114] mm: optimize do_wp_page() for exclusive pages in the swapcache Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:13 ` [patch 100/114] mm: optimize do_wp_page() for fresh pages in local LRU pagevecs Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:13 ` [patch 101/114] mm: slightly clarify KSM logic in do_swap_page() Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:13 ` [patch 102/114] mm: streamline COW " Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:13 ` [patch 103/114] mm/huge_memory: streamline COW logic in do_huge_pmd_wp_page() Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:13 ` [patch 104/114] mm/khugepaged: remove reuse_swap_page() usage Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:13 ` [patch 105/114] mm/swapfile: remove stale reuse_swap_page() Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:13 ` [patch 106/114] mm/huge_memory: remove stale page_trans_huge_mapcount() Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:13 ` [patch 107/114] mm/huge_memory: remove stale locking logic from __split_huge_pmd() Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:13 ` [patch 108/114] mm: warn on deleting redirtied only if accounted Andrew Morton
2022-03-25  1:13   ` Andrew Morton
2022-03-25  1:14 ` [patch 109/114] mm: unmap_mapping_range_tree() with i_mmap_rwsem shared Andrew Morton
2022-03-25  1:14   ` Andrew Morton
2022-03-25  1:14 ` [patch 110/114] mm: generalize ARCH_HAS_FILTER_PGPROT Andrew Morton
2022-03-25  1:14 ` [patch 111/114] mm: fix race between MADV_FREE reclaim and blkdev direct IO read Andrew Morton
2022-03-25  1:14   ` Andrew Morton
2022-03-25  1:14 ` [patch 112/114] mm: madvise: MADV_DONTNEED_LOCKED Andrew Morton
2022-03-25  1:14   ` Andrew Morton
2022-03-25  1:14 ` [patch 113/114] selftests: vm: remove dependecy from internal kernel macros Andrew Morton
2022-03-25  1:14   ` Andrew Morton
2022-03-25  1:56   ` Linus Torvalds
2022-03-25  1:14 ` [patch 114/114] selftests: kselftest framework: provide "finished" helper Andrew Morton
2022-03-25  1:14   ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220325011202.F275DC340F3@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=andreyknvl@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=linux-mm@kvack.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=ryabinin.a.a@gmail.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vincenzo.frascino@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.