sh: uaccess: Handle exception on second instruction of __put_user_u64
PATCH 1/1 sh: uaccess: Handle exception on second instruction of __put_user_u64
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(+)
arch/sh/include/asm/uaccess_32.h +2 -0
@@ -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) \