Skip to content

Commit

Permalink
kasan: No KASAN's memmove check if archs don't have it.
Browse files Browse the repository at this point in the history
If archs don't have memmove then the C implementation from lib/string.c is used,
and then it's instrumented by compiler. So there is no need to add KASAN's
memmove to manual checks.

Signed-off-by: Nick Hu <[email protected]>
Acked-by: Dmitry Vyukov <[email protected]>
Acked-by: Andrey Ryabinin <[email protected]>
Signed-off-by: Palmer Dabbelt <[email protected]>
  • Loading branch information
Nick Hu authored and palmer-dabbelt committed Jan 22, 2020
1 parent def9d27 commit 57ee58e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mm/kasan/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ void *memset(void *addr, int c, size_t len)
return __memset(addr, c, len);
}

#ifdef __HAVE_ARCH_MEMMOVE
#undef memmove
void *memmove(void *dest, const void *src, size_t len)
{
Expand All @@ -118,6 +119,7 @@ void *memmove(void *dest, const void *src, size_t len)

return __memmove(dest, src, len);
}
#endif

#undef memcpy
void *memcpy(void *dest, const void *src, size_t len)
Expand Down

0 comments on commit 57ee58e

Please sign in to comment.