[STABLE PATCH 5.15.y] arm64: lib: Import latest version of Arm Optimized Routines' strncmp

Greg KH gregkh at linuxfoundation.org
Thu Sep 7 04:23:23 PDT 2023


On Wed, Sep 06, 2023 at 07:03:36PM +0100, Will Deacon wrote:
> From: Joey Gouly <joey.gouly at arm.com>
> 
> commit 387d828adffcf1eb949f3141079c479793c59aac upstream.
> 
> Import the latest version of the Arm Optimized Routines strncmp function based
> on the upstream code of string/aarch64/strncmp.S at commit 189dfefe37d5 from:
>   https://github.com/ARM-software/optimized-routines
> 
> This latest version includes MTE support.
> 
> Note that for simplicity Arm have chosen to contribute this code to Linux under
> GPLv2 rather than the original MIT OR Apache-2.0 WITH LLVM-exception license.
> Arm is the sole copyright holder for this code.
> 
> Signed-off-by: Joey Gouly <joey.gouly at arm.com>
> Cc: Robin Murphy <robin.murphy at arm.com>
> Cc: Mark Rutland <mark.rutland at arm.com>
> Cc: Catalin Marinas <catalin.marinas at arm.com>
> Cc: Will Deacon <will at kernel.org>
> Acked-by: Mark Rutland <mark.rutland at arm.com>
> Acked-by: Catalin Marinas <catalin.marinas at arm.com>
> Link: https://lore.kernel.org/r/20220301101435.19327-3-joey.gouly@arm.com
> (cherry picked from commit 387d828adffcf1eb949f3141079c479793c59aac)
> Cc: <stable at vger.kernel.org> # 5.15.y only
> Fixes: 020b199bc70d ("arm64: Import latest version of Cortex Strings' strncmp")
> Reported-by: John Hsu <John.Hsu at mediatek.com>
> Link: https://lore.kernel.org/all/e9f30f7d5b7d72a3521da31ab2002b49a26f542e.camel@mediatek.com/
> Signed-off-by: Will Deacon <will at kernel.org>
> ---
> 
> This is a clean cherry-pick of the latest MTE-safe strncmp()
> implementation for arm64 which landed in v5.18 and somewhat accidentally
> fixed an out-of-bounds read introduced in v5.14.
> An alternative would be to disable the optimised code altogether, but
> given that this is self-contained and applies cleanly, I'd favour being
> consistent with more recent kernels.
> 
>  arch/arm64/lib/strncmp.S | 244 +++++++++++++++++++++++----------------
>  1 file changed, 146 insertions(+), 98 deletions(-)

Now queued up, thanks.

greg k-h



More information about the linux-arm-kernel mailing list