From: Alexander Potapenko Date: Fri, 25 Mar 2016 21:22:11 +0000 (-0700) Subject: kasan: test fix: warn if the UAF could not be detected in kmalloc_uaf2 X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=9dcadd381b1d199074937019d612346c061de415;p=openwrt%2Fstaging%2Fblogic.git kasan: test fix: warn if the UAF could not be detected in kmalloc_uaf2 Signed-off-by: Alexander Potapenko Acked-by: Andrey Ryabinin Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: Andrey Konovalov Cc: Dmitry Vyukov Cc: Steven Rostedt Cc: Konstantin Serebryany Cc: Dmitry Chernenkov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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); }