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>

@@ -18,10 +18,11 @@
  *
  * CDDL HEADER END
  */
 /*
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2019 Joyent, Inc.
  */
         
 #include <sys/asm_linkage.h>
 #include <sys/asm_misc.h>
 #include <sys/regset.h>

@@ -758,14 +759,16 @@
         /*
          * skip iff function pointer is NULL
          */
         cmpq    $0, ap_mlsetup
         je      3f
-        call    *ap_mlsetup
+        leaq    ap_mlsetup, %rax
+        INDIRECT_CALL_REG(rax)
 3:
 
-        call    *cpr_start_cpu_func
+        leaq    cpr_start_cpu_func, %rax
+        INDIRECT_CALL_REG(rax)
 
 / restore %rbx to the value it ahd before we called the functions above
         movq    rm_platter_va, %rbx
         addq    $WC_CPU, %rbx