Currently, KASAN-KUnit tests check a per-task flag set in KASAN bug reporting routines to make sure that KASAN can detect bugs as expected. Instead, KASAN could use console tracepoints like KFENCE/KCSAN do. This will allow to port more tests to KUnit, like ones that trigger a KASAN bug report in a different task (see kasan_rcu_uaf test in lib/test_kasan_module.c). This will also allow to be perform more checks on the content of reports.
Mailed a patch series that makes KASAN tests use console tracepoints to check whether a report has been printed and makes two more tests KUnit-compatible [1]. Checking reports' contents for correctness is not implemented is this series. [1] https://lore.kernel.org/linux-mm/653d43e9a6d9aad2ae148a941dab048cb8e765a8.1664044241.git.andreyknvl@google.com/
Resolved with [1]. Checking reports' contents is tracked in [2]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7ce0ea19d50e4e97a8da69f616ffa8afbb532a93 [2] https://bugzilla.kernel.org/show_bug.cgi?id=198441