Skip to content

kasan: integrate with init_on_alloc/free

Andrey Konovalov linux-arm-kernel linux-mm lkml 3 versions – Applied

Status from this message: [merged] kasan-mm-integrate-slab-init_on_free-with-hw_tags.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 0 repliesApplied 5/5
  2. v25 patches 5 repliesSuperseded
  3. v15 patches 8 repliesSuperseded

Changes in v3 from the cover letter

- Move init variable check out of initialization loop in mte_set_mem_tag_range().

Patches in v3 All 5 applied

#Subject and filesSizeRepliesApplied
1/5arm64: kasan: allow to init memory when setting tagsarch/arm64/include/asm/memory.h arch/arm64/include/asm/mte-kasan.h mm/kasan/kasan.h+32 -200 repliesApplied
2/5kasan: init memory in kasan_(un)poison for HW_TAGSlib/test_kasan.c mm/kasan/common.c mm/kasan/generic.c +3 more+36 -340 repliesApplied
3/5kasan, mm: integrate page_alloc init with HW_TAGSinclude/linux/kasan.h mm/kasan/common.c mm/mempool.c +1 more+54 -250 repliesApplied
4/5kasan, mm: integrate slab init_on_alloc with HW_TAGSinclude/linux/kasan.h mm/kasan/common.c mm/slab.c +2 more+43 -410 repliesApplied
5/5kasan, mm: integrate slab init_on_free with HW_TAGSinclude/linux/kasan.h mm/kasan/common.c mm/slab.c +1 more+48 -330 repliesApplied

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchMarco Elver
1/5A-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

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

Read the v3 thread

Cover letter [PATCH v3 0/5] kasan: integrate with init_on_alloc/free

This patch series integrates HW_TAGS KASAN with init_on_alloc/free by initializing memory via the same arm64 instruction that sets memory tags.

This is expected to improve HW_TAGS KASAN performance when init_on_alloc/free is enabled. The exact perfomance numbers are unknown as MTE-enabled hardware doesn't exist yet.

Changes v2->v3:
- Move init variable check out of initialization loop in mte_set_mem_tag_range().

Changes v1->v2:
- Add and use kasan_has_integrated_init() helper.
- Update comments to not explicitly mention relation between HW_TAGS KASAN and memory init.
- Fix non initting memory with kasan=off by checking kasan_enabled() instead of IS_ENABLED(CONFIG_KASAN_HW_TAGS).

Andrey Konovalov (5):
arm64: kasan: allow to init memory when setting tags
kasan: init memory in kasan_(un)poison for HW_TAGS kasan, mm: integrate page_alloc init with HW_TAGS kasan, mm: integrate slab init_on_alloc with HW_TAGS kasan, mm: integrate slab init_on_free with HW_TAGS

 arch/arm64/include/asm/memory.h    |  4 +-
 arch/arm64/include/asm/mte-kasan.h | 39 +++++++++++------
 include/linux/kasan.h              | 48 +++++++++++++-------
 lib/test_kasan.c                   |  4 +-
 mm/kasan/common.c                  | 45 +++++++++----------
 mm/kasan/generic.c                 | 12 ++---
 mm/kasan/kasan.h                   | 19 ++++----
 mm/kasan/shadow.c                  | 10 ++---
 mm/kasan/sw_tags.c                 |  2 +-
 mm/mempool.c                       |  4 +-
 mm/page_alloc.c                    | 37 +++++++++++-----
 mm/slab.c                          | 43 ++++++++++--------
 mm/slab.h                          | 17 ++++++--
 mm/slub.c                          | 70 +++++++++++++++---------------
 14 files changed, 207 insertions(+), 147 deletions(-)
Signature · 1 line
2.30.1.766.gb4fecdf3b7-goog