Commit 6de9c648 authored by OGAWA Hirofumi's avatar OGAWA Hirofumi Committed by Paul Mundt

sh: Proper __put_user_asm() size mismatch fix.

This fixes up the workaround in 2b4b2bb4
and cleans up __put_user_asm() to get the sizing right from the onset.
Signed-off-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent d27e0854
...@@ -77,8 +77,9 @@ struct __large_struct { unsigned long buf[100]; }; ...@@ -77,8 +77,9 @@ struct __large_struct { unsigned long buf[100]; };
({ \ ({ \
long __pu_err; \ long __pu_err; \
__typeof__(*(ptr)) __user *__pu_addr = (ptr); \ __typeof__(*(ptr)) __user *__pu_addr = (ptr); \
__typeof__(*(ptr)) __pu_val = x; \
__chk_user_ptr(ptr); \ __chk_user_ptr(ptr); \
__put_user_size((x), __pu_addr, (size), __pu_err); \ __put_user_size(__pu_val, __pu_addr, (size), __pu_err); \
__pu_err; \ __pu_err; \
}) })
...@@ -86,8 +87,9 @@ struct __large_struct { unsigned long buf[100]; }; ...@@ -86,8 +87,9 @@ struct __large_struct { unsigned long buf[100]; };
({ \ ({ \
long __pu_err = -EFAULT; \ long __pu_err = -EFAULT; \
__typeof__(*(ptr)) __user *__pu_addr = (ptr); \ __typeof__(*(ptr)) __user *__pu_addr = (ptr); \
__typeof__(*(ptr)) __pu_val = x; \
if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) \ if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) \
__put_user_size((x), __pu_addr, (size), \ __put_user_size(__pu_val, __pu_addr, (size), \
__pu_err); \ __pu_err); \
__pu_err; \ __pu_err; \
}) })
......
...@@ -76,8 +76,7 @@ do { \ ...@@ -76,8 +76,7 @@ do { \
__put_user_asm(x, ptr, retval, "w"); \ __put_user_asm(x, ptr, retval, "w"); \
break; \ break; \
case 4: \ case 4: \
__put_user_asm((u32)x, ptr, \ __put_user_asm(x, ptr, retval, "l"); \
retval, "l"); \
break; \ break; \
case 8: \ case 8: \
__put_user_u64(x, ptr, retval); \ __put_user_u64(x, ptr, retval); \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment