]> www.infradead.org Git - users/jedix/linux-maple.git/commit
kasan: test: avoid corrupting memory in kasan_rcu_uaf
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:04 +0000 (09:34 +1000)
commitc14bdc7bee4f6e093e32a9ee34a20cd01338957a
tree8979476757e5bb9fc58bfecd660751809c8b02a5
parentd65154586ce5dfea425b306f1bb99c67e2f2c659
kasan: test: avoid corrupting memory in kasan_rcu_uaf

kasan_rcu_uaf() writes to freed memory via kasan_rcu_reclaim(), 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.

Turn the write into a read.

Link: https://lkml.kernel.org/r/b6f2c3bf712d2457c783fa59498225b66a634f62.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_module.c