Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5dabd17

Browse files
lecopzertorvalds
authored andcommittedJan 24, 2021
kasan: fix incorrect arguments passing in kasan_add_zero_shadow
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: 0207df4 ("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>
1 parent a11a496 commit 5dabd17

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎mm/kasan/init.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,6 @@ int kasan_add_zero_shadow(void *start, unsigned long size)
486486

487487
ret = kasan_populate_early_shadow(shadow_start, shadow_end);
488488
if (ret)
489-
kasan_remove_zero_shadow(shadow_start,
490-
size >> KASAN_SHADOW_SCALE_SHIFT);
489+
kasan_remove_zero_shadow(start, size);
491490
return ret;
492491
}

0 commit comments

Comments
 (0)
Please sign in to comment.