]> git.karo-electronics.de Git - karo-tx-linux.git/commit
kasan: Fix a type conversion error
authorWang Long <long.wanglong@huawei.com>
Wed, 21 Oct 2015 22:03:23 +0000 (09:03 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 21 Oct 2015 22:03:23 +0000 (09:03 +1100)
commit6bfcd08da3d2ada96db245248b0e0fc935e13bfc
treec3d80e27b477e098e52eb3aa96798b8c737b895e
parenta21f8341c4d8312408b8783976ecf148d92094e4
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>
mm/kasan/kasan.c