[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250902.183822.721197619957773341.rene@exactcode.com>
Date: Tue, 02 Sep 2025 18:38:22 +0200 (CEST)
From: Rene Rebe <rene@...ctcode.com>
To: kernel@...rcher.dialup.fu-berlin.de
Cc: linux-kernel@...r.kernel.org, sparclinux@...r.kernel.org,
andreas@...sler.com, glaubitz@...sik.fu-berlin.de,
anthony.yznaga@...cle.com
Subject: Re: [PATCH 2/4] sparc: fix accurate exception reporting in
copy_{from_to}_user for UltraSPARC III
Hi,
From: Michael Karcher <kernel@...rcher.dialup.fu-berlin.de>
> Based on a finding by Anthony Yznaga that the UltraSPARC III copy_from_user
> returns invalid values breaking other parts of the kernel in case of a
> fault, while the generic implementation is correct.
Tested-by: René Rebe <rene@...ctcode.com> # UltraSparc III+ and UltraSparc IIIi
> Fixes: ee841d0aff64 ("sparc64: Convert U3copy_{from,to}_user to accurate exception reporting.")
> Signed-off-by: Michael Karcher <kernel@...rcher.dialup.fu-berlin.de>
> ---
> arch/sparc/lib/U3memcpy.S | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/sparc/lib/U3memcpy.S b/arch/sparc/lib/U3memcpy.S
> index 9248d59c734c..bace3a18f836 100644
> --- a/arch/sparc/lib/U3memcpy.S
> +++ b/arch/sparc/lib/U3memcpy.S
> @@ -267,6 +267,7 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
> faligndata %f10, %f12, %f26
> EX_LD_FP(LOAD(ldd, %o1 + 0x040, %f0), U3_retl_o2)
>
> + and %o2, 0x3f, %o2
> subcc GLOBAL_SPARE, 0x80, GLOBAL_SPARE
> add %o1, 0x40, %o1
> bgu,pt %XCC, 1f
> @@ -336,7 +337,6 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
> * Also notice how this code is careful not to perform a
> * load past the end of the src buffer.
> */
> - and %o2, 0x3f, %o2
> andcc %o2, 0x38, %g2
> be,pn %XCC, 2f
> subcc %g2, 0x8, %g2
> --
> 2.50.1
>
>
--
René Rebe, ExactCODE GmbH, Berlin, Germany
https://exactcode.com | https://t2linux.com | https://rene.rebe.de
Powered by blists - more mailing lists