diff options
author | Lecopzer Chen <lecopzer@gmail.com> | 2021-01-24 08:01:29 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-27 13:55:23 +0300 |
commit | fee5a83dfc4af016b8cd957d8bd4e289954588ef (patch) | |
tree | d8ab02ff63a851f9fb0502bee298dbb80825f539 /mm/kasan | |
parent | ecd63f04e72879b7c85c9e12698d2a3aabe34c94 (diff) | |
download | linux-fee5a83dfc4af016b8cd957d8bd4e289954588ef.tar.xz |
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 <lecopzer.chen@mediatek.com>
Reviewed-by: Andrey Konovalov <andreyknvl@google.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Alexander Potapenko <glider@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/kasan')
-rw-r--r-- | mm/kasan/init.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/kasan/init.c b/mm/kasan/init.c index 7dd63b736e6e..b8c6ec172bb2 100644 --- a/mm/kasan/init.c +++ b/mm/kasan/init.c @@ -492,7 +492,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; } |