aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/entry/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/entry/common.c')
-rw-r--r--arch/x86/entry/common.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
index d5eee851071c..08a945d7915e 100644
--- a/arch/x86/entry/common.c
+++ b/arch/x86/entry/common.c
@@ -394,8 +394,20 @@ __visible long do_fast_syscall_32(struct pt_regs *regs)
394 * WARNING: We are in CONTEXT_USER and RCU isn't paying attention! 394 * WARNING: We are in CONTEXT_USER and RCU isn't paying attention!
395 */ 395 */
396 local_irq_enable(); 396 local_irq_enable();
397 if (get_user(*(u32 *)&regs->cx, 397 if (
398 (u32 __user __force *)(unsigned long)(u32)regs->sp)) { 398#ifdef CONFIG_X86_64
399 /*
400 * Micro-optimization: the pointer we're following is explicitly
401 * 32 bits, so it can't be out of range.
402 */
403 __get_user(*(u32 *)&regs->cx,
404 (u32 __user __force *)(unsigned long)(u32)regs->sp)
405#else
406 get_user(*(u32 *)&regs->cx,
407 (u32 __user __force *)(unsigned long)(u32)regs->sp)
408#endif
409 ) {
410
399 /* User code screwed up. */ 411 /* User code screwed up. */
400 local_irq_disable(); 412 local_irq_disable();
401 regs->ax = -EFAULT; 413 regs->ax = -EFAULT;