Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/traps: Clarify KCFI instruction layout

Just a nit-picky change to the KCFI indirect call check instruction
documentation. The addl offset isn't always -4 (it depends on patchable
function entry configuration).

Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250904034656.3670313-2-kees@kernel.org

authored by

Kees Cook and committed by
Peter Zijlstra
628a15e0 038c7dc6

+1 -1
+1 -1
arch/x86/kernel/cfi.c
··· 27 27 * for indirect call checks: 28 28 * 29 29 *   movl -<id>, %r10d ; 6 bytes 30 - * addl -4(%reg), %r10d ; 4 bytes 30 + * addl -<pos>(%reg), %r10d; 4 bytes 31 31 * je .Ltmp1 ; 2 bytes 32 32 * ud2 ; <- regs->ip 33 33 * .Ltmp1: