Skip to contentSkip to conversation

x86: Don't cast away the __user in __get_user_asm_u64()

PATCH New Ville Syrjala 1 participant 1 message Sep 12, 2017 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: Don't cast away the __user in __get_user_asm_u64()

From: Ville Syrjälä <[email protected]>

Don't cast away the __user in __get_user_asm_u64() on x86-32. Avoids sparse getting upset.

Cc Benjamin LaHaise <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
---
 arch/x86/include/asm/uaccess.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/uaccess.h +1 -1
index 30269dafec47..1a7d930c33d9 100644
@@ -332,7 +332,7 @@ do {									\
 		     _ASM_EXTABLE(1b, 4b)				\
 		     _ASM_EXTABLE(2b, 4b)				\
 		     : "=r" (retval), "=&A"(x)				\
-		     : "m" (__m(__ptr)), "m" __m(((u32 *)(__ptr)) + 1),	\
+		     : "m" (__m(__ptr)), "m" __m(((u32 __user *)(__ptr)) + 1),	\
 		       "i" (errret), "0" (retval));			\
 })
 
Signature · 1 line
2.13.5