]> git.baikalelectronics.ru Git - kernel.git/commit
lib/test_kasan.c: make kmalloc_oob_krealloc_less more correctly
authorWang Long <long.wanglong@huawei.com>
Wed, 9 Sep 2015 22:37:22 +0000 (15:37 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 10 Sep 2015 20:29:01 +0000 (13:29 -0700)
commite986d0f0162607fb0a73fa19c4a6c79a87aed2d8
tree977fffd2756175eb42271dc10585a453745fffe0
parenteabbdcef51197df8a3d07cc28f0c8adf8902bb90
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
correct.

Signed-off-by: Wang Long <long.wanglong@huawei.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/test_kasan.c