diff options
author | Alexander Potapenko <glider@google.com> | 2016-03-25 22:22:11 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-26 00:37:42 +0100 |
commit | 9dcadd381b1d199074937019d612346c061de415 (patch) | |
tree | dc1f5da028014392088d534d019e3ee3ba788565 /lib/test_kasan.c | |
parent | mm, kasan: stackdepot implementation. Enable stackdepot for SLAB (diff) | |
download | linux-9dcadd381b1d199074937019d612346c061de415.tar.xz linux-9dcadd381b1d199074937019d612346c061de415.zip |
kasan: test fix: warn if the UAF could not be detected in kmalloc_uaf2
Signed-off-by: Alexander Potapenko <glider@google.com>
Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Andrey Konovalov <adech.fo@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Konstantin Serebryany <kcc@google.com>
Cc: Dmitry Chernenkov <dmitryc@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r-- | lib/test_kasan.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/test_kasan.c b/lib/test_kasan.c index 90ad74f71535..82169fbf2453 100644 --- a/lib/test_kasan.c +++ b/lib/test_kasan.c @@ -294,6 +294,8 @@ static noinline void __init kmalloc_uaf2(void) } ptr1[40] = 'x'; + if (ptr1 == ptr2) + pr_err("Could not detect use-after-free: ptr1 == ptr2\n"); kfree(ptr2); } |