Re: [PATCH] ARM: uaccess: Fix KASAN false-positives

From: Arnd Bergmann
Date: Wed Feb 15 2023 - 05:08:15 EST


On Wed, Feb 15, 2023, at 03:37, Zev Weiss wrote:
> From: Andrew Jeffery <andrew@xxxxxxxx>
>
> __copy_to_user_memcpy() and __clear_user_memset() had been calling
> memcpy() and memset() respectively, leading to false-positive KASAN
> reports when starting userspace:
>
> [ 10.707901] Run /init as init process
> [ 10.731892] process '/bin/busybox' started with executable stack
> [ 10.745234]
> ==================================================================
> [ 10.745796] BUG: KASAN: user-memory-access in
> __clear_user_memset+0x258/0x3ac
> [ 10.747260] Write of size 2687 at addr 000de581 by task init/1
>
> Use __memcpy() and __memset() instead to allow userspace access, which
> is of course the intent of these functions.
>
> Signed-off-by: Andrew Jeffery <andrew@xxxxxxxx>
> Signed-off-by: Zev Weiss <zev@xxxxxxxxxxxxxxxxx>

Looks good to me. I've added it to my randconfig build tree to
see if there are any build time regressions in odd configurations.
If you don't hear back from me until tomorrow, please add this to
Russell's patch system at

https://www.arm.linux.org.uk/developer/patches/info.php

with my

Reviewed-by: Arnd Bergmann <arnd@xxxxxxxx>