kernel_samsung_a53x/arch/x86/lib
Borislav Petkov (AMD) 2ef3c376a2 x86/retpoline: Do the necessary fixup to the Zen3/4 srso return thunk for !SRSO
Commit 0e110732473e14d6520e49d75d2c88ef7d46fe67 upstream.

The srso_alias_untrain_ret() dummy thunk in the !CONFIG_MITIGATION_SRSO
case is there only for the altenative in CALL_UNTRAIN_RET to have
a symbol to resolve.

However, testing with kernels which don't have CONFIG_MITIGATION_SRSO
enabled, leads to the warning in patch_return() to fire:

  missing return thunk: srso_alias_untrain_ret+0x0/0x10-0x0: eb 0e 66 66 2e
  WARNING: CPU: 0 PID: 0 at arch/x86/kernel/alternative.c:826 apply_returns (arch/x86/kernel/alternative.c:826

Put in a plain "ret" there so that gcc doesn't put a return thunk in
in its place which special and gets checked.

In addition:

  ERROR: modpost: "srso_alias_untrain_ret" [arch/x86/kvm/kvm-amd.ko] undefined!
  make[2]: *** [scripts/Makefile.modpost:145: Module.symvers] Chyba 1
  make[1]: *** [/usr/src/linux-6.8.3/Makefile:1873: modpost] Chyba 2
  make: *** [Makefile:240: __sub-make] Chyba 2

since !SRSO builds would use the dummy return thunk as reported by
petr.pisar@atlas.cz, https://bugzilla.kernel.org/show_bug.cgi?id=218679.

Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202404020901.da75a60f-oliver.sang@intel.com
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/all/202404020901.da75a60f-oliver.sang@intel.com/
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-19 09:23:11 +01:00
..
atomic64_32.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atomic64_386_32.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atomic64_cx8_32.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cache-smp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
checksum_32.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clear_page_64.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cmdline.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cmpxchg8b_emu.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cmpxchg16b_emu.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
copy_mc.c iov_iter, x86: Be consistent about the __user tag on copy_mc_to_user() 2024-11-18 11:42:39 +01:00
copy_mc_64.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
copy_page_64.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
copy_user_64.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpu.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
csum-copy_64.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
csum-partial_64.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
csum-wrappers_64.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
delay.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
error-inject.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
getuser.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hweight.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
inat.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
insn-eval.c x86/stackprotector/32: Make the canary into a regular percpu variable 2024-11-19 09:22:37 +01:00
insn.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
iomap_copy_64.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
iomem.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kaslr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
memcpy_32.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
memcpy_64.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
memmove_64.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
memset_64.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
misc.c x86/lib: Fix overflow when counting digits 2024-11-18 12:12:19 +01:00
mmx_32.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
msr-reg-export.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
msr-reg.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
msr-smp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
msr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
putuser.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
retpoline.S x86/retpoline: Do the necessary fixup to the Zen3/4 srso return thunk for !SRSO 2024-11-19 09:23:11 +01:00
string_32.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
strstr_32.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
usercopy.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
usercopy_32.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
usercopy_64.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
x86-opcode-map.txt Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00