Bug 212203

Summary: KASAN: use console tracepoints for tests
Product: Memory Management Reporter: Andrey Konovalov (andreyknvl)
Component: SanitizersAssignee: MM/Sanitizers virtual assignee (mm_sanitizers)
Status: RESOLVED CODE_FIX    
Severity: normal CC: kasan-dev
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: upstream Subsystem:
Regression: No Bisected commit-id:

Description Andrey Konovalov 2021-03-09 16:33:53 UTC
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.
Comment 1 Andrey Konovalov 2022-09-24 20:29:05 UTC
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/
Comment 2 Andrey Konovalov 2022-12-24 01:33:20 UTC
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