Commit f3fd3c0a authored by Tim Chen's avatar Tim Chen Committed by Marcelo Henrique Cerri

x86/entry: Use retpoline for syscall's indirect calls

CVE-2017-5753
CVE-2017-5715
Signed-off-by: default avatarTim Chen <tim.c.chen@linux.intel.com>
Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
(backported from commit 48ec0cfa6dac428470e30855e2d9751e00e2ba6c)
Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
parent 70df98e2
...@@ -195,7 +195,21 @@ entry_SYSCALL_64_fastpath: ...@@ -195,7 +195,21 @@ entry_SYSCALL_64_fastpath:
#endif #endif
ja 1f /* return -ENOSYS (already in pt_regs->ax) */ ja 1f /* return -ENOSYS (already in pt_regs->ax) */
movq %r10, %rcx movq %r10, %rcx
call *sys_call_table(, %rax, 8)
/*
* This call instruction is handled specially in stub_ptregs_64.
* It might end up jumping to the slow path. If it jumps, RAX
* and all argument registers are clobbered.
*/
movq sys_call_table(, %rax, 8), %r10
jmp 1001f
1004: callq 1002f
1003: nop
jmp 1003b
1002: mov %r10, (%rsp)
retq
1001: callq 1004b
movq %rax, RAX(%rsp) movq %rax, RAX(%rsp)
1: 1:
/* /*
......
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