Print this page
11787 Kernel needs to be built with retpolines
11788 Kernel needs to generally use RSB stuffing
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: John Levon <john.levon@joyent.com>

@@ -753,11 +753,11 @@
 
 #if defined(__amd64)
 
         ENTRY_NP(i86_mwait)
         pushq   %rbp
-        call    *x86_md_clear
+        call    x86_md_clear
         movq    %rsp, %rbp
         movq    %rdi, %rax              /* data */
         movq    %rsi, %rcx              /* extensions */
         .byte   0x0f, 0x01, 0xc9        /* mwait */
         leave

@@ -2558,11 +2558,12 @@
         addq    %rdi, %rsi
         leaq    .ip_ocsum_jmptbl(%rip), %rdi
         leaq    (%rdi, %rcx, 8), %rdi
         xorl    %ecx, %ecx
         clc
-        jmp     *(%rdi)
+        movq    (%rdi), %rdi
+        INDIRECT_JMP_REG(rdi)
 
         .align  8
 .ip_ocsum_jmptbl:
         .quad   .only0, .only4, .only8, .only12, .only16, .only20
         .quad   .only24, .only28, .only32, .only36, .only40, .only44

@@ -3608,11 +3609,12 @@
          * We need to call *gethrtimef before picking up CLOCK_LOCK (obviously,
          * hres_last_tick can only be modified while holding CLOCK_LOCK).
          * At worst, performing this now instead of under CLOCK_LOCK may
          * introduce some jitter in pc_gethrestime().
          */
-        call    *gethrtimef(%rip)
+        movq    gethrtimef(%rip), %rsi
+        INDIRECT_CALL_REG(rsi)
         movq    %rax, %r8
 
         leaq    hres_lock(%rip), %rax
         movb    $-1, %dl
 .CL1:

@@ -4088,11 +4090,11 @@
         movq    %rsp, %rbp              /* set up stack frame */
         movq    %rdi, %rsp              /* switch stack pointer */
         movq    %rdx, %rdi              /* pass func arg 1 */
         movq    %rsi, %r11              /* save function to call */
         movq    %rcx, %rsi              /* pass func arg 2 */
-        call    *%r11                   /* call function */
+        INDIRECT_CALL_REG(r11)          /* call function */
         leave                           /* restore stack */
         ret
         SET_SIZE(switch_sp_and_call)
 
 #elif defined(__i386)