SUPERH platform development
 help / color / mirror / Atom feed
* [PATCH] sh: uaccess: Handle exception on second instruction of __put_user_u64
@ 2026-05-06 18:32 Ben Hutchings
  0 siblings, 0 replies; only message in thread
From: Ben Hutchings @ 2026-05-06 18:32 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker, John Paul Adrian Glaubitz; +Cc: linux-sh

[-- Attachment #1: Type: text/plain, Size: 1245 bytes --]

Each entry in the exception table only covers a single instruction,
but there are 2 instructions that could fault in __put_user_u64.

__get_user_u64 never had this bug.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
I noticed and meant to fix this bug in 2019, but then the patch
lingered in a git branch since then.  Today I found and rewrote it to
match the way Adrian did the exception table for __get_user_u64.  I
have not tested this version at all, though.

Ben.

 arch/sh/include/asm/uaccess_32.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/sh/include/asm/uaccess_32.h b/arch/sh/include/asm/uaccess_32.h
index 5d7ddc092afd..26096258e43b 100644
--- a/arch/sh/include/asm/uaccess_32.h
+++ b/arch/sh/include/asm/uaccess_32.h
@@ -194,6 +194,7 @@ __asm__ __volatile__( \
 	".previous\n" \
 	".section	__ex_table,\"a\"\n\t" \
 	".long	1b, 3b\n\t" \
+	".long	1b + 2, 3b\n\t" \
 	".previous" \
 	: "=r" (retval) \
 	: "r" (val), "m" (__m(addr)), "i" (-EFAULT), "0" (retval) \
@@ -216,6 +217,7 @@ __asm__ __volatile__( \
 	".previous\n" \
 	".section	__ex_table,\"a\"\n\t" \
 	".long	1b, 3b\n\t" \
+	".long	1b + 2, 3b\n\t" \
 	".previous" \
 	: "=r" (retval) \
 	: "r" (val), "m" (__m(addr)), "i" (-EFAULT), "0" (retval) \

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-06 18:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-06 18:32 [PATCH] sh: uaccess: Handle exception on second instruction of __put_user_u64 Ben Hutchings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox