kasan: Fix a type conversion error
authorWang Long <long.wanglong@huawei.com>
Fri, 6 Nov 2015 02:51:18 +0000 (18:51 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Nov 2015 03:34:48 +0000 (19:34 -0800)
commite0d57714394f5e2ce4e2f9bbebf48e3c7a7fd3be
tree2da40842cee7132a446b023d49f51dabed0bc534
parentf523e737c08f5daaec9fac017e1bc5695e6f2760
kasan: Fix a type conversion error

The current KASAN code can not find the following out-of-bounds bugs:

        char *ptr;
        ptr = kmalloc(8, GFP_KERNEL);
        memset(ptr+7, 0, 2);

the cause of the problem is the type conversion error in
*memory_is_poisoned_n* function.  So this patch fix that.

Signed-off-by: Wang Long <long.wanglong@huawei.com>
Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/kasan/kasan.c