File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 44
44
#include <asm/asm.h>
45
45
#include <asm/smap.h>
46
46
#include <asm/frame.h>
47
+ #include <asm/nospec-branch.h>
47
48
48
49
.section .entry.text, "ax"
49
50
@@ -290,7 +291,7 @@ ENTRY(ret_from_fork)
290
291
291
292
/* kernel thread */
292
293
1: movl %edi , %eax
293
- call * %ebx
294
+ CALL_NOSPEC %ebx
294
295
/*
295
296
* A kernel thread is allowed to return here after successfully
296
297
* calling do_execve(). Exit to userspace to complete the execve()
@@ -919,7 +920,7 @@ common_exception:
919
920
movl %ecx , %es
920
921
TRACE_IRQS_OFF
921
922
movl %esp , %eax # pt_regs pointer
922
- call * %edi
923
+ CALL_NOSPEC %edi
923
924
jmp ret_from_exception
924
925
END(common_exception)
925
926
Original file line number Diff line number Diff line change 37
37
#include <asm/pgtable_types.h>
38
38
#include <asm/export.h>
39
39
#include <asm/frame.h>
40
+ #include <asm/nospec-branch.h>
40
41
#include <linux/err.h>
41
42
42
43
#include "calling.h"
@@ -187,7 +188,7 @@ ENTRY(entry_SYSCALL_64_trampoline)
187
188
*/
188
189
pushq %rdi
189
190
movq $entry_SYSCALL_64_stage2, %rdi
190
- jmp * %rdi
191
+ JMP_NOSPEC %rdi
191
192
END(entry_SYSCALL_64_trampoline)
192
193
193
194
.popsection
@@ -266,7 +267,12 @@ entry_SYSCALL_64_fastpath:
266
267
* It might end up jumping to the slow path. If it jumps, RAX
267
268
* and all argument registers are clobbered.
268
269
*/
270
+ #ifdef CONFIG_RETPOLINE
271
+ movq sys_call_table(, %rax , 8 ), %rax
272
+ call __x86_indirect_thunk_rax
273
+ #else
269
274
call *sys_call_table(, %rax , 8 )
275
+ #endif
270
276
.Lentry_SYSCALL_64_after_fastpath_call:
271
277
272
278
movq %rax , RAX(%rsp )
@@ -438,7 +444,7 @@ ENTRY(stub_ptregs_64)
438
444
jmp entry_SYSCALL64_slow_path
439
445
440
446
1:
441
- jmp * %rax /* Called from C */
447
+ JMP_NOSPEC %rax /* Called from C */
442
448
END(stub_ptregs_64)
443
449
444
450
.macro ptregs_stub func
@@ -517,7 +523,7 @@ ENTRY(ret_from_fork)
517
523
1:
518
524
/* kernel thread */
519
525
movq %r12 , %rdi
520
- call * %rbx
526
+ CALL_NOSPEC %rbx
521
527
/*
522
528
* A kernel thread is allowed to return here after successfully
523
529
* calling do_execve(). Exit to userspace to complete the execve()
You can’t perform that action at this time.
0 commit comments