From: Lecopzer Chen Date: Sun, 24 Jan 2021 05:01:29 +0000 (-0800) Subject: kasan: fix incorrect arguments passing in kasan_add_zero_shadow X-Git-Tag: v5.4.93~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=da3711f42c68326faf20ce3ce07c4c4709fa530a;p=thirdparty%2Fkernel%2Fstable.git kasan: fix incorrect arguments passing in kasan_add_zero_shadow commit 5dabd1712cd056814f9ab15f1d68157ceb04e741 upstream. kasan_remove_zero_shadow() shall use original virtual address, start and size, instead of shadow address. Link: https://lkml.kernel.org/r/20210103063847.5963-1-lecopzer@gmail.com Fixes: 0207df4fa1a86 ("kernel/memremap, kasan: make ZONE_DEVICE with work with KASAN") Signed-off-by: Lecopzer Chen Reviewed-by: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dan Williams Cc: Dmitry Vyukov Cc: Alexander Potapenko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- diff --git a/mm/kasan/init.c b/mm/kasan/init.c index 75e41cb7313d5..ee21e1c1150c6 100644 --- a/mm/kasan/init.c +++ b/mm/kasan/init.c @@ -503,7 +503,6 @@ int kasan_add_zero_shadow(void *start, unsigned long size) ret = kasan_populate_early_shadow(shadow_start, shadow_end); if (ret) - kasan_remove_zero_shadow(shadow_start, - size >> KASAN_SHADOW_SCALE_SHIFT); + kasan_remove_zero_shadow(start, size); return ret; }