]> www.infradead.org Git - users/jedix/linux-maple.git/commit
kasan: test: only do kmalloc_uaf_memset for generic mode
authorAndrey Konovalov <andreyknvl@gmail.com>
Mon, 23 Aug 2021 23:59:25 +0000 (09:59 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Aug 2021 23:34:03 +0000 (09:34 +1000)
commit97420c52bed1e66bf674fb9c336c78c4565a1d14
tree1c91485d51931dc9d4997c3272ab2cdaeae46faf
parent99a89f3309ae8943e3877d34cfc2b7b48774bc78
kasan: test: only do kmalloc_uaf_memset for generic mode

kmalloc_uaf_memset() writes to freed memory, which is only safe with the
GENERIC mode (as it uses quarantine).  For other modes, this test corrupts
kernel memory, which might result in a crash.

Only enable kmalloc_uaf_memset() for the GENERIC mode.

Link: https://lkml.kernel.org/r/2e1c87b607b1292556cde3cab2764f108542b60c.1628779805.git.andreyknvl@gmail.com
Signed-off-by: Andrey Konovalov <andreyknvl@gmail.com>
Reviewed-by: Marco Elver <elver@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
lib/test_kasan.c