]> git.baikalelectronics.ru Git - kernel.git/commit
kasan: test: support async (again) and asymm modes for HW_TAGS
authorAndrey Konovalov <andreyknvl@google.com>
Fri, 25 Mar 2022 01:12:02 +0000 (18:12 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 25 Mar 2022 02:06:48 +0000 (19:06 -0700)
commitb65a6d7c2c91132a529dcd4fcccf4238f7c313d2
treed8905ad03cf22fd131d8ef78913bcb29ba28e6dc
parent3f7fcba8c74b3232e631ea831bf7613cf1bab88d
kasan: test: support async (again) and asymm modes for HW_TAGS

Async mode support has already been implemented in commit a6a4f4641fd9
("kasan, arm64: tests supports for HW_TAGS async mode") but then got
accidentally broken in commit 9cb2a6cd5dff ("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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/kasan.h
lib/test_kasan.c
mm/kasan/hw_tags.c
mm/kasan/kasan.h
mm/kasan/report.c