[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181029102922.GC14127@arm.com>
Date: Mon, 29 Oct 2018 10:29:23 +0000
From: Will Deacon <will.deacon@....com>
To: Andrey Ryabinin <aryabinin@...tuozzo.com>
Cc: Catalin Marinas <catalin.marinas@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Kyeongdon Kim <kyeongdon.kim@....com>,
Ard Biesheuvel <ard.biesheuvel@...aro.org>,
Alexander Potapenko <glider@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>, kasan-dev@...glegroups.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Mark Rutland <mark.rutland@....com>
Subject: Re: [PATCH v2 2/3] arm64: lib: use C string functions with KASAN
enabled.
On Thu, Sep 20, 2018 at 04:56:30PM +0300, Andrey Ryabinin wrote:
> ARM64 has asm implementation of memchr(), memcmp(), str[r]chr(),
> str[n]cmp(), str[n]len(). KASAN don't see memory accesses in asm
> code, thus it can potentially miss many bugs.
>
> Ifdef out __HAVE_ARCH_* defines of these functions when KASAN is
> enabled, so the generic implementations from lib/string.c will be used.
>
> We can't just remove the asm functions because efistub uses them.
> And we can't have two non-weak functions either, so declare the asm
> functions as weak.
>
> Reported-by: Kyeongdon Kim <kyeongdon.kim@....com>
> Signed-off-by: Andrey Ryabinin <aryabinin@...tuozzo.com>
> ---
> Changes since v1:
> - Use WEAK() instead of .weak
>
> arch/arm64/include/asm/string.h | 14 ++++++++------
> arch/arm64/kernel/arm64ksyms.c | 7 +++++--
> arch/arm64/lib/memchr.S | 2 +-
> arch/arm64/lib/memcmp.S | 2 +-
> arch/arm64/lib/strchr.S | 2 +-
> arch/arm64/lib/strcmp.S | 2 +-
> arch/arm64/lib/strlen.S | 2 +-
> arch/arm64/lib/strncmp.S | 2 +-
> arch/arm64/lib/strnlen.S | 2 +-
> arch/arm64/lib/strrchr.S | 2 +-
> 10 files changed, 21 insertions(+), 16 deletions(-)
Acked-by: Will Deacon <will.deacon@....com>
Please post these again after the merge window and we'll figure out how to
get them queued.
Will
Powered by blists - more mailing lists