Skip to content

Commit 9dcadd3

Browse files
ramosian-glidertorvalds
authored andcommitted
kasan: test fix: warn if the UAF could not be detected in kmalloc_uaf2
Signed-off-by: Alexander Potapenko <[email protected]> Acked-by: Andrey Ryabinin <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: David Rientjes <[email protected]> Cc: Joonsoo Kim <[email protected]> Cc: Andrey Konovalov <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Konstantin Serebryany <[email protected]> Cc: Dmitry Chernenkov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent cd11016 commit 9dcadd3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/test_kasan.c

+2
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ static noinline void __init kmalloc_uaf2(void)
294294
}
295295

296296
ptr1[40] = 'x';
297+
if (ptr1 == ptr2)
298+
pr_err("Could not detect use-after-free: ptr1 == ptr2\n");
297299
kfree(ptr2);
298300
}
299301

0 commit comments

Comments
 (0)