[PATCH] sh: uaccess: Handle exception on second instruction of __put_user_u64

Ben Hutchings <[email protected]>
Newsgroups gmane.linux.ports.sh.devel
Message-ID <[email protected]>
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 <[email protected]>
---
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) \
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEErCspvTSmr92z9o8157/I7JWGEQkFAmn7iUoACgkQ57/I7JWG
EQlvMQ/9Fz6BJMJ/uk1q4HXBbzgsgef41r3+VC/jJEaJOOxLpuqTrICBMaGF3bFn
fyAEOfKu43nVbiFZypzdnm9/4htDneO8832k/KC+dTvmeFs471KSb/zQqLg8rnsl
XwGgcHKqvyp3OEyoAFW1B1nUNv67D26RZiNqE9Vounfye37G6Vtw0ayusYvn4Gqu
xqNdrZasY5DZJDJTbg8QKZSKuojpD+r3Gbm4rhSvoSvooamB0YcjxLI+lNbxoHVU
3YNNc14PFnQjdO9tJ6N7lHTBq4LqtffAKy5Z5FMFS5NboB2+KbHSlK0EW25ITPmZ
aNLxd4UBDi2Lj9zzwuc02PZBt864vZH7Ekw61LyuJlLd0dvfuJeYXdzAZruOcOXh
aKdzJ30bQyUPOIvG16AChmHH+6CaDpGfpVy/s3Ih1sYS+pFKU/1XKPwWQH45f5fP
bjwxlFzL0j1mkShG0YRy3GdNs5rpfZnnXOKcR/la4MGs3ajGZBSE891GG3ABTSmJ
cDhzfyGbaIUeYLQWSbwc64iN1MrRhcyQ0sk+AMckYYWlgCOxs0izAi/Mlh1+57rR
KXh4QQMVejhdgi5ienxchj1k7PlI1g7WrrwXgQ7hXmdX42K/MNP2MN9WiPk9SI6i
aSLe8ivYdbUJI8Zm+KRyMMGCF7EpPlwzMpDRktFS3jr7jeRUPgA=
=QMqy
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.