Skip to contentSkip to conversation

x86: uaccess_64: fix return value in __copy_from_user()

PATCH Applied Hiroshi Shimamoto 2 participants 2 messages Nov 14, 2008 – Nov 18, 2008 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: uaccess_64: fix return value in __copy_from_user()

From: Hiroshi Shimamoto <[email protected]>

__copy_from_user() will return invalid value 16 when it fails to access user space and the size is 10.

---
 arch/x86/include/asm/uaccess_64.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/include/asm/uaccess_64.h +1 -1
index 543ba88..84210c4 100644
@@ -48,7 +48,7 @@ int __copy_from_user(void *dst, const void __user *src, unsigned size)
 		return ret;
 	case 10:
 		__get_user_asm(*(u64 *)dst, (u64 __user *)src,
-			       ret, "q", "", "=r", 16);
+			       ret, "q", "", "=r", 10);
 		if (unlikely(ret))
 			return ret;
 		__get_user_asm(*(u16 *)(8 + (char *)dst),
Signature · 1 line
1.5.6
Applied
#1 lore raw
Quoted 9 lines · Hiroshi Shimamoto

From: Hiroshi Shimamoto <[email protected]>

__copy_from_user() will return invalid value 16 when it fails to access user space and the size is 10.

---
 arch/x86/include/asm/uaccess_64.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

applied to tip/x86/urgent, thanks!

Ingo