Skip to content

kasan: test: avoid crashing the kernel with HW_TAGS

[email protected] linux-mm lkml 2 versions – Applied

Status from this message: [merged] kasan-test-avoid-corrupting-memory-in-kasan_rcu_uaf.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 2 repliesApplied 8/8
  2. v18 patches 11 repliesSuperseded

Changes in v2 from the cover letter

- Touch both good and bad memory in memset tests as suggested by Marco.

Patches in v2 All 8 applied

#Subject and filesSizeRepliesApplied
1/8kasan: test: rework kmalloc_oob_rightlib/test_kasan.c+18 -20 repliesApplied
2/8kasan: test: avoid writing invalid memorylib/test_kasan.c+7 -70 repliesApplied
3/8kasan: test: avoid corrupting memory via memsetlib/test_kasan.c+17 -110 repliesApplied
4/8kasan: test: disable kmalloc_memmove_invalid_size for HW_TAGSlib/test_kasan.c+7 -10 repliesApplied
5/8kasan: test: only do kmalloc_uaf_memset for generic modelib/test_kasan.c+6 -00 repliesApplied
6/8kasan: test: clean up ksize_uaflib/test_kasan.c+2 -20 repliesApplied
7/8kasan: test: avoid corrupting memory in copy_user_testlib/test_kasan_module.c+8 -100 repliesApplied
8/8kasan: test: avoid corrupting memory in kasan_rcu_uaflib/test_kasan_module.c+1 -10 repliesApplied

Reviews trailers per patch

None of the 8 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMarco Elver
SeriesR-b
1/8
2/8
3/8
4/8
5/8
6/8
7/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/8] kasan: test: avoid crashing the kernel with HW_TAGS

From: Andrey Konovalov <[email protected]>

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(-)
Signature · 1 line
2.25.1