Skip to content

Commit

Permalink
kasan: fix incorrect arguments passing in kasan_add_zero_shadow
Browse files Browse the repository at this point in the history
kasan_remove_zero_shadow() shall use original virtual address, start and
size, instead of shadow address.

Link: https://lkml.kernel.org/r/[email protected]
Fixes: 0207df4 ("kernel/memremap, kasan: make ZONE_DEVICE with work with KASAN")
Signed-off-by: Lecopzer Chen <[email protected]>
Reviewed-by: Andrey Konovalov <[email protected]>
Cc: Andrey Ryabinin <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
Cc: Alexander Potapenko <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
lecopzer authored and torvalds committed Jan 24, 2021
1 parent a11a496 commit 5dabd17
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mm/kasan/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,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;
}

0 comments on commit 5dabd17

Please sign in to comment.