Skip to content

Commit 5096732

Browse files
dwmw2KAGA-KOKO
authored andcommitted
x86/retpoline/checksum32: Convert assembler indirect jumps
Convert all indirect jumps in 32bit checksum assembler code to use non-speculative sequences when CONFIG_RETPOLINE is enabled. Signed-off-by: David Woodhouse <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Arjan van de Ven <[email protected]> Acked-by: Ingo Molnar <[email protected]> Cc: [email protected] Cc: Rik van Riel <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: [email protected] Cc: Peter Zijlstra <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Kees Cook <[email protected]> Cc: Tim Chen <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Paul Turner <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent ea08816 commit 5096732

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

arch/x86/lib/checksum_32.S

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
#include <asm/errno.h>
3030
#include <asm/asm.h>
3131
#include <asm/export.h>
32-
32+
#include <asm/nospec-branch.h>
33+
3334
/*
3435
* computes a partial checksum, e.g. for TCP/UDP fragments
3536
*/
@@ -156,7 +157,7 @@ ENTRY(csum_partial)
156157
negl %ebx
157158
lea 45f(%ebx,%ebx,2), %ebx
158159
testl %esi, %esi
159-
jmp *%ebx
160+
JMP_NOSPEC %ebx
160161

161162
# Handle 2-byte-aligned regions
162163
20: addw (%esi), %ax
@@ -439,7 +440,7 @@ ENTRY(csum_partial_copy_generic)
439440
andl $-32,%edx
440441
lea 3f(%ebx,%ebx), %ebx
441442
testl %esi, %esi
442-
jmp *%ebx
443+
JMP_NOSPEC %ebx
443444
1: addl $64,%esi
444445
addl $64,%edi
445446
SRC(movb -32(%edx),%bl) ; SRC(movb (%edx),%bl)

0 commit comments

Comments
 (0)