aboutsummaryrefslogtreecommitdiffstats
path: root/mm/kasan/report.c
diff options
context:
space:
mode:
authorAndrey Konovalov <[email protected]>2021-03-15 13:20:19 +0000
committerCatalin Marinas <[email protected]>2021-04-11 09:57:45 +0000
commite80a76aa1a91018d919d2210366943f9bf17009e (patch)
tree1062ce71ffb0e6a77729fbc3dd1daecadaa01054 /mm/kasan/report.c
parentarm64: mte: Report async tag faults before suspend (diff)
downloadkernel-e80a76aa1a91018d919d2210366943f9bf17009e.tar.gz
kernel-e80a76aa1a91018d919d2210366943f9bf17009e.zip
kasan, arm64: tests supports for HW_TAGS async mode
This change adds KASAN-KUnit tests support for the async HW_TAGS mode. In async mode, tag fault aren't being generated synchronously when a bad access happens, but are instead explicitly checked for by the kernel. As each KASAN-KUnit test expect a fault to happen before the test is over, check for faults as a part of the test handler. Acked-by: Catalin Marinas <[email protected]> Acked-by: Andrey Konovalov <[email protected]> Tested-by: Andrey Konovalov <[email protected]> Signed-off-by: Andrey Konovalov <[email protected]> Signed-off-by: Vincenzo Frascino <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
Diffstat (limited to 'mm/kasan/report.c')
-rw-r--r--mm/kasan/report.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mm/kasan/report.c b/mm/kasan/report.c
index 8b0843a2cdd7..14bd51ea2348 100644
--- a/mm/kasan/report.c
+++ b/mm/kasan/report.c
@@ -366,6 +366,11 @@ void kasan_report_async(void)
{
unsigned long flags;
+#if IS_ENABLED(CONFIG_KUNIT)
+ if (current->kunit_test)
+ kasan_update_kunit_status(current->kunit_test);
+#endif /* IS_ENABLED(CONFIG_KUNIT) */
+
start_report(&flags);
pr_err("BUG: KASAN: invalid-access\n");
pr_err("Asynchronous mode enabled: no access details available\n");