Skip to content

Commit f1fe879

Browse files
terminusBrian Maly
authored andcommitted
x86/retpoline/ia32entry: Convert to non-speculative calls
Convert indirect jumps in 32-bit compat entry assembler code to use non-speculative sequences when CONFIG_RETPOLINE is enabled. The ia32entry code does not care about the length of the CALL_NOSPEC fragment, so unlike similar indirect callsites in entry_64.S we use CALL_NOSPEC everywhere. Orabug: 29909295 CVE: CVE-2017-5715 Based on entry_64.S changes in upstream commit 2641f08. Reported-by: Jamie Iles <[email protected]> Signed-off-by: Ankur Arora <[email protected]> Reviewed-by: Boris Ostrovsky <[email protected]> Signed-off-by: Brian Maly <[email protected]>
1 parent aa13454 commit f1fe879

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

arch/x86/ia32/ia32entry.S

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ sysenter_do_call:
191191
movl %ebx,%edi /* arg1 */
192192
movl %edx,%edx /* arg3 (zero extension) */
193193
sysenter_dispatch:
194-
call *ia32_sys_call_table(,%rax,8)
194+
movq ia32_sys_call_table(,%rax,8), %rax
195+
CALL_NOSPEC %rax
195196
movq %rax,RAX(%rsp)
196197
DISABLE_INTERRUPTS(CLBR_NONE)
197198
TRACE_IRQS_OFF
@@ -429,7 +430,8 @@ cstar_do_call:
429430
movl %ebx,%edi /* arg1 */
430431
movl %edx,%edx /* arg3 (zero extension) */
431432
cstar_dispatch:
432-
call *ia32_sys_call_table(,%rax,8)
433+
movq ia32_sys_call_table(,%rax,8), %rax
434+
CALL_NOSPEC %rax
433435
movq %rax,RAX(%rsp)
434436
DISABLE_INTERRUPTS(CLBR_NONE)
435437
TRACE_IRQS_OFF
@@ -577,7 +579,8 @@ ia32_do_call:
577579
xchg %ecx,%esi /* rsi:arg2, rcx:arg4 */
578580
movl %ebx,%edi /* arg1 */
579581
movl %edx,%edx /* arg3 (zero extension) */
580-
call *ia32_sys_call_table(,%rax,8) # xxx: rip relative
582+
movq ia32_sys_call_table(,%rax,8), %rax
583+
CALL_NOSPEC %rax
581584
ia32_sysret:
582585
movq %rax,RAX(%rsp)
583586
ia32_ret_from_sys_call:
@@ -640,7 +643,7 @@ ia32_ptregs_common:
640643
CFI_REL_OFFSET rsp,RSP
641644
/* CFI_REL_OFFSET ss,SS*/
642645
SAVE_EXTRA_REGS 8
643-
call *%rax
646+
CALL_NOSPEC %rax
644647
RESTORE_EXTRA_REGS 8
645648
ret
646649
CFI_ENDPROC

0 commit comments

Comments
 (0)