linux-stable/arch/x86
Borislav Petkov (AMD) 3ec21104c8 x86/retpoline: Do the necessary fixup to the Zen3/4 srso return thunk for !SRSO
commit 0e11073247 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-04-10 16:35:51 +02:00
..
boot x86/efistub: Add missing boot_params for mixed mode compat entry 2024-04-03 15:28:53 +02:00
coco x86/sev: Fix position dependent variable references in startup code 2024-04-03 15:28:50 +02:00
configs - The first, cleanup part of the microcode loader reorg tglx has been 2023-08-28 15:55:20 -07:00
crypto crypto: x86/sha - load modules based on CPU features 2023-11-28 17:19:56 +00:00
entry x86/entry_32: Add VERW just before userspace transition 2024-03-06 14:48:44 +00:00
events perf/x86/amd/lbr: Use freeze based on availability 2024-04-10 16:35:47 +02:00
hyperv x86/hyperv: Use per cpu initial stack for vtl context 2024-03-26 18:20:06 -04:00
ia32
include x86/bugs: Fix the SRSO mitigation on Zen3/4 2024-04-10 16:35:50 +02:00
kernel x86/srso: Disentangle rethunk-dependent options 2024-04-10 16:35:50 +02:00
kvm x86/cpufeatures: Add CPUID_LNX_5 to track recently added Linux-defined word 2024-04-10 16:35:48 +02:00
lib x86/retpoline: Do the necessary fixup to the Zen3/4 srso return thunk for !SRSO 2024-04-10 16:35:51 +02:00
math-emu
mm Revert "x86/mm/ident_map: Use gbpages only where full GB page should be mapped." 2024-04-10 16:35:46 +02:00
net x86/bpf: Fix IP after emitting call depth accounting 2024-04-10 16:35:48 +02:00
pci x86/pci: Reserve ECAM if BIOS didn't include it in PNP0C02 _CRS 2024-01-25 15:35:48 -08:00
platform efi/x86: Move EFI runtime call setup/teardown helpers out of line 2023-09-11 06:37:50 +00:00
power mm/treewide: replace pud_large() with pud_leaf() 2024-04-10 16:35:46 +02:00
purgatory x86/purgatory: Remove LTO flags 2023-09-17 09:49:03 +02:00
ras
realmode
tools x86, relocs: Ignore relocations in .notes section 2024-03-26 18:19:35 -04:00
um um: Hard-code the result of 'uname -s' 2023-08-26 22:40:37 +02:00
video
virt/vmx/tdx
xen mm/treewide: replace pud_large() with pud_leaf() 2024-04-10 16:35:46 +02:00
.gitignore
Kbuild
Kconfig x86/Kconfig: Remove CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT 2024-04-03 15:28:50 +02:00
Kconfig.assembler
Kconfig.cpu x86/Kconfig: Transmeta Crusoe is CPU family 5, not 6 2024-02-23 09:25:10 +01:00
Kconfig.debug
Makefile Kbuild updates for v6.6 2023-09-05 11:01:47 -07:00
Makefile.postlink
Makefile.um
Makefile_32.cpu