Commit 6b4a35fc authored by Wang Long's avatar Wang Long Committed by Linus Torvalds

lib/test_kasan.c: make kmalloc_oob_krealloc_less more correctly

In kmalloc_oob_krealloc_less, I think it is better to test
the size2 boundary.

If we do not call krealloc, the access of position size1 will still cause
out-of-bounds and access of position size2 does not.  After call krealloc,
the access of position size2 cause out-of-bounds.  So using size2 is more
Signed-off-by: default avatarWang Long <>
Cc: Andrey Ryabinin <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 9789d8e0
......@@ -114,7 +114,7 @@ static noinline void __init kmalloc_oob_krealloc_less(void)
ptr2[size1] = 'x';
ptr2[size2] = 'x';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment