linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/8] kasan: test: avoid crashing the kernel with HW_TAGS
@ 2021-08-12 14:53 andrey.konovalov
  2021-08-12 14:53 ` [PATCH v2 1/8] kasan: test: rework kmalloc_oob_right andrey.konovalov
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: andrey.konovalov @ 2021-08-12 14:53 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Andrey Konovalov, Andrey Ryabinin, Marco Elver, Dmitry Vyukov,
	Alexander Potapenko, kasan-dev, linux-mm, linux-kernel

From: Andrey Konovalov <andreyknvl@gmail.com>

KASAN tests do out-of-bounds and use-after-free accesses. Running the
tests works fine for the GENERIC mode, as it uses qurantine and redzones.
But the HW_TAGS mode uses neither, and running the tests might crash
the kernel.

Rework the tests to avoid corrupting kernel memory.

Changes v1->v2:
- Touch both good and bad memory in memset tests as suggested by Marco.

Andrey Konovalov (8):
  kasan: test: rework kmalloc_oob_right
  kasan: test: avoid writing invalid memory
  kasan: test: avoid corrupting memory via memset
  kasan: test: disable kmalloc_memmove_invalid_size for HW_TAGS
  kasan: test: only do kmalloc_uaf_memset for generic mode
  kasan: test: clean up ksize_uaf
  kasan: test: avoid corrupting memory in copy_user_test
  kasan: test: avoid corrupting memory in kasan_rcu_uaf

 lib/test_kasan.c        | 80 +++++++++++++++++++++++++++++------------
 lib/test_kasan_module.c | 20 +++++------
 2 files changed, 66 insertions(+), 34 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-08-12 15:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-12 14:53 [PATCH v2 0/8] kasan: test: avoid crashing the kernel with HW_TAGS andrey.konovalov
2021-08-12 14:53 ` [PATCH v2 1/8] kasan: test: rework kmalloc_oob_right andrey.konovalov
2021-08-12 14:53 ` [PATCH v2 2/8] kasan: test: avoid writing invalid memory andrey.konovalov
2021-08-12 14:53 ` [PATCH v2 3/8] kasan: test: avoid corrupting memory via memset andrey.konovalov
2021-08-12 14:53 ` [PATCH v2 4/8] kasan: test: disable kmalloc_memmove_invalid_size for HW_TAGS andrey.konovalov
2021-08-12 14:53 ` [PATCH v2 5/8] kasan: test: only do kmalloc_uaf_memset for generic mode andrey.konovalov
2021-08-12 14:56 ` [PATCH v2 6/8] kasan: test: clean up ksize_uaf andrey.konovalov
2021-08-12 15:00 ` [PATCH v2 7/8] kasan: test: avoid corrupting memory in copy_user_test andrey.konovalov
2021-08-12 15:05 ` [PATCH v2 8/8] kasan: test: avoid corrupting memory in kasan_rcu_uaf andrey.konovalov
2021-08-12 15:05 ` [PATCH v2 0/8] kasan: test: avoid crashing the kernel with HW_TAGS Andrey Konovalov
2021-08-12 15:44   ` Marco Elver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).