]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ARM: 9290/1: uaccess: Fix KASAN false-positives
authorAndrew Jeffery <andrew@aj.id.au>
Tue, 21 Feb 2023 23:10:14 +0000 (00:10 +0100)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Fri, 24 Mar 2023 14:25:32 +0000 (10:25 -0400)
commite1363f76075b7a64df12f6533f521faa78b6460c
tree28289e23de807c471af2267ecd3f903dc657eb73
parent647a2799127e11ea9ef463470e1e2f8e8e304c1e
ARM: 9290/1: uaccess: Fix KASAN false-positives

__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@aj.id.au>
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
arch/arm/lib/uaccess_with_memcpy.c