]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
sparc: fix accurate exception reporting in copy_{from_to}_user for UltraSPARC
authorMichael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Thu, 4 Sep 2025 22:03:30 +0000 (00:03 +0200)
committerAndreas Larsson <andreas@gaisler.com>
Fri, 19 Sep 2025 18:56:36 +0000 (20:56 +0200)
commit4fba1713001195e59cfc001ff1f2837dab877efb
treeff915779e7c48e0453fd4f3b0e61830d87eb4c13
parent7205ef77dfe167df1b83aea28cf00fc02d662990
sparc: fix accurate exception reporting in copy_{from_to}_user for UltraSPARC

The referenced commit introduced exception handlers on user-space memory
references in copy_from_user and copy_to_user. These handlers return from
the respective function and calculate the remaining bytes left to copy
using the current register contents. This commit fixes a couple of bad
calculations. This will fix the return value of copy_from_user and
copy_to_user in the faulting case. The behaviour of memcpy stays unchanged.

Fixes: cb736fdbb208 ("sparc64: Convert U1copy_{from,to}_user to accurate exception reporting.")
Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> # on QEMU 10.0.3
Tested-by: René Rebe <rene@exactcode.com> # on Ultra 5 UltraSparc IIi
Tested-by: Jonathan 'theJPster' Pallant <kernel@thejpster.org.uk> # on Sun Netra T1
Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Reviewed-by: Andreas Larsson <andreas@gaisler.com>
Link: https://lore.kernel.org/r/20250905-memcpy_series-v4-1-1ca72dda195b@mkarcher.dialup.fu-berlin.de
Signed-off-by: Andreas Larsson <andreas@gaisler.com>
arch/sparc/lib/U1memcpy.S