UPSTREAM: 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> Bug: 64145065 (cherry-picked from 9dcadd381b1d199074937019d612346c061de415) Change-Id: I1111f642f21b3821d5e594e80d32db03fbce186c Signed-off-by: Paul Lawrence <paullawrence@google.com>
This commit is contained in:
parent
adb03f57aa
commit
b2bd0e0b3d
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue