[1/4] x86, putuser: add ASM_CALL_CONSTRAINT
diff mbox series

Message ID 20190316210127.GA21830@avx2
State New, archived
Headers show
Series
  • [1/4] x86, putuser: add ASM_CALL_CONSTRAINT
Related show

Commit Message

Alexey Dobriyan March 16, 2019, 9:01 p.m. UTC
Clobber stack pointer given that assembly does CALL.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 arch/x86/include/asm/uaccess.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Borislav Petkov March 24, 2019, 9:32 p.m. UTC | #1
On Sun, Mar 17, 2019 at 12:01:27AM +0300, Alexey Dobriyan wrote:
> Clobber stack pointer given that assembly does CALL.

Clobber?

Comment over ASM_CALL_CONSTRAINT talks about something else.

Also, pls change all your subject prefixes to

"x86/uaccess: ..."

Patch
diff mbox series

--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -176,7 +176,8 @@  __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL))
 })
 
 #define __put_user_x(size, x, ptr, __ret_pu)			\
-	asm volatile("call __put_user_" #size : "=a" (__ret_pu)	\
+	asm volatile("call __put_user_" #size			\
+		     : "=a" (__ret_pu), ASM_CALL_CONSTRAINT	\
 		     : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")