This is a note to let you know that I've just added the patch titled x86/retpoline: Do the necessary fixup to the Zen3/4 srso return thunk for !SRSO to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: x86-retpoline-do-the-necessary-fixup-to-the-zen3-4-srso-return-thunk-for-srso.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From stable+bounces-36113-greg=kroah.com@xxxxxxxxxxxxxxx Fri Apr 5 16:21:04 2024 From: Borislav Petkov <bp@xxxxxxxxx> Date: Fri, 5 Apr 2024 16:20:35 +0200 Subject: x86/retpoline: Do the necessary fixup to the Zen3/4 srso return thunk for !SRSO To: gregkh@xxxxxxxxxxxxxxxxxxx Cc: mingo@xxxxxxxxxx, torvalds@xxxxxxxxxxxxxxxxxxxx, stable@xxxxxxxxxxxxxxx Message-ID: <20240405142035.GDZhAIs8LmOTRIpM3U@fat_crate.local> Content-Disposition: inline From: "Borislav Petkov (AMD)" <bp@xxxxxxxxx> 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@xxxxxxxx, https://bugzilla.kernel.org/show_bug.cgi?id=218679. Reported-by: kernel test robot <oliver.sang@xxxxxxxxx> Closes: https://lore.kernel.org/oe-lkp/202404020901.da75a60f-oliver.sang@xxxxxxxxx Signed-off-by: Borislav Petkov (AMD) <bp@xxxxxxxxx> Link: https://lore.kernel.org/all/202404020901.da75a60f-oliver.sang@xxxxxxxxx/ Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/x86/lib/retpoline.S | 1 + 1 file changed, 1 insertion(+) --- a/arch/x86/lib/retpoline.S +++ b/arch/x86/lib/retpoline.S @@ -108,6 +108,7 @@ SYM_START(srso_alias_untrain_ret, SYM_L_ ret int3 SYM_FUNC_END(srso_alias_untrain_ret) +__EXPORT_THUNK(srso_alias_untrain_ret) #endif SYM_START(srso_alias_safe_ret, SYM_L_GLOBAL, SYM_A_NONE) Patches currently in stable-queue which might be from kroah.com@xxxxxxxxxxxxxxx are queue-5.10/x86-rfds-mitigate-register-file-data-sampling-rfds.patch queue-5.10/vfio-pci-create-persistent-intx-handler.patch queue-5.10/x86-entry_32-add-verw-just-before-userspace-transition.patch queue-5.10/vfio-fsl-mc-block-calling-interrupt-handler-without-trigger.patch queue-5.10/x86-bugs-add-asm-helpers-for-executing-verw.patch queue-5.10/vfio-pci-disable-auto-enable-of-exclusive-intx-irq.patch queue-5.10/x86-bugs-fix-the-srso-mitigation-on-zen3-4.patch queue-5.10/x86-retpoline-do-the-necessary-fixup-to-the-zen3-4-srso-return-thunk-for-srso.patch queue-5.10/vfio-pci-lock-external-intx-masking-ops.patch queue-5.10/vfio-introduce-interface-to-flush-virqfd-inject-workqueue.patch queue-5.10/kvm-x86-export-rfds_no-and-rfds_clear-to-guests.patch queue-5.10/x86-asm-add-_asm_rip-macro-for-x86-64-rip-suffix.patch queue-5.10/x86-entry_64-add-verw-just-before-userspace-transition.patch queue-5.10/x86-mmio-disable-kvm-mitigation-when-x86_feature_clear_cpu_buf-is-set.patch queue-5.10/x86-bugs-use-alternative-instead-of-mds_user_clear-static-key.patch queue-5.10/documentation-hw-vuln-add-documentation-for-rfds.patch queue-5.10/kvm-vmx-use-bt-jnc-i.e.-eflags.cf-to-select-vmresume-vs.-vmlaunch.patch queue-5.10/mm-migrate-set-swap-entry-values-of-thp-tail-pages-properly.patch queue-5.10/kvm-vmx-move-verw-closer-to-vmentry-for-mds-mitigation.patch queue-5.10/vfio-platform-create-persistent-irq-handlers.patch