]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
sparc: fix accurate exception reporting in copy_to_user for Niagara 4
authorMichael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Thu, 4 Sep 2025 22:03:33 +0000 (00:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Oct 2025 09:56:35 +0000 (11:56 +0200)
commitf4ca41f739ae9dea9f8aaff8ea045f2ef8cdf339
treeb0be5753f899e7951211c49258644211a58e7a60
parenta365ee556e45f780ee322b349a06efdad0c1458f
sparc: fix accurate exception reporting in copy_to_user for Niagara 4

[ Upstream commit 5a746c1a2c7980de6c888b6373299f751ad7790b ]

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 bad calculation.
This will fix the return value of copy_to_user in a specific faulting case.
The behaviour of memcpy stays unchanged.

Fixes: 957077048009 ("sparc64: Convert NG4copy_{from,to}_user to accurate exception reporting.")
Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> # on Oracle SPARC T4-1
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-4-1ca72dda195b@mkarcher.dialup.fu-berlin.de
Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/sparc/lib/NG4memcpy.S