Skip to content

kasan: detect invalid frees

Dmitry Vyukov linux-mm lkml 1 version Applied

Status from this message: [merged] kasan-detect-invalid-frees.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 0 repliesApplied 5/5

Patches in v1 All 5 applied

#Subject and filesSizeRepliesApplied
1/5kasan: detect invalid frees for large objectsinclude/linux/kasan.h lib/test_kasan.c mm/kasan/kasan.c +3 more+44 -150 repliesApplied
2/5kasan: don't use __builtin_return_address(1)include/linux/kasan.h mm/kasan/kasan.c mm/kasan/kasan.h +3 more+19 -180 repliesApplied
3/5kasan: detect invalid frees for large mempool objectsinclude/linux/kasan.h mm/kasan/kasan.c mm/mempool.c+13 -80 repliesApplied
4/5kasan: unify code between kasan_slab_free() and kasan_poison_kfree()mm/kasan/kasan.c+12 -160 repliesApplied
5/5kasan: detect invalid freeslib/test_kasan.c mm/kasan/kasan.c+56 -00 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] kasan: detect invalid frees

KASAN detects double-frees, but does not detect invalid-frees (when a pointer into a middle of heap object is passed to free). We recently had a very unpleasant case in crypto code which freed an inner object inside of a heap allocation. This left unnoticed during free, but totally corrupted heap and later lead to a bunch of random crashes all over kernel code.

Detect invalid frees.

Dmitry Vyukov (5):
kasan: detect invalid frees for large objects
kasan: don't use __builtin_return_address(1)
kasan: detect invalid frees for large mempool objects
kasan: unify code between kasan_slab_free() and kasan_poison_kfree()
kasan: detect invalid frees

 include/linux/kasan.h | 13 ++++----
 lib/test_kasan.c      | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++
 mm/kasan/kasan.c      | 57 +++++++++++++++++++----------------
 mm/kasan/kasan.h      |  3 +-
 mm/kasan/report.c     |  5 ++--
 mm/mempool.c          |  6 ++--
 mm/slab.c             |  6 ++--
 mm/slub.c             | 10 +++----
 8 files changed, 135 insertions(+), 48 deletions(-)
Signature · 7 lines
2.15.1.620.gb9897f4670-goog

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>