Files
kernel_arpi/lib/test_kasan.c
Andrey Konovalov 52c83986c9 BACKPORT: kasan: test: support async (again) and asymm modes for HW_TAGS
[Backport: fix conflicts with commit d9f210a14d ("ANDROID: kunit:
 Provision kunit as a vendor module") that removed CONFIG_KUNIT checks.]

Async mode support has already been implemented in commit e80a76aa1a
("kasan, arm64: tests supports for HW_TAGS async mode") but then got
accidentally broken in commit 99734b535d ("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>
(cherry picked from commit ed6d74446cbfb88c747d4b32477a9d46132694db)
Bug: 217222520
Change-Id: I8be7f20e72efe7ad81999dc75c848fb89664602c
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
2022-04-20 00:35:10 +00:00

37 KiB