lkml.org 
[lkml]   [2019]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 1/3] kasan: Archs don't check memmove if not support it.
From
On Mon, 07 Oct 2019 23:11:51 PDT (-0700), nickhu@andestech.com wrote:
> Skip the memmove checking for those archs who don't support it.
>
> Signed-off-by: Nick Hu <nickhu@andestech.com>
> ---
> mm/kasan/common.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/mm/kasan/common.c b/mm/kasan/common.c
> index 6814d6d6a023..897f9520bab3 100644
> --- a/mm/kasan/common.c
> +++ b/mm/kasan/common.c
> @@ -107,6 +107,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)
> {
> @@ -115,6 +116,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)

I think this is backwards: we shouldn't be defining an arch-specific memmove
symbol when KASAN is enabled. If we do it this way then we're defeating the
memmove checks, which doesn't seem like the right way to go.

\
 
 \ /
  Last update: 2019-10-16 21:24    [W:0.088 / U:4.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site