From a2bcc9b341e11a8358e61dc87d7d125f1aa9cbbd Mon Sep 17 00:00:00 2001 From: Nikolay Borisov Date: Feb 22 2024 10:12:20 +0000 Subject: x86/entry_32: Add VERW just before userspace transition (git-fixes). --- diff --git a/patches.suse/x86-entry_32-Add-VERW-just-before-userspace-transition.patch b/patches.suse/x86-entry_32-Add-VERW-just-before-userspace-transition.patch new file mode 100644 index 0000000..0f1ef64 --- /dev/null +++ b/patches.suse/x86-entry_32-Add-VERW-just-before-userspace-transition.patch @@ -0,0 +1,44 @@ +From: Pawan Gupta +Date: Tue, 13 Feb 2024 18:22:08 -0800 +Subject: x86/entry_32: Add VERW just before userspace transition +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git +Git-commit: a0e2dab44d22b913b4c228c8b52b2a104434b0b3 +Patch-mainline: Queued in subsystem maintainer repo +References: git-fixes + +As done for entry_64, add support for executing VERW late in exit to +user path for 32-bit mode. + +Cc: +Signed-off-by: Pawan Gupta +Acked-by: Nikolay Borisov +--- + arch/x86/entry/entry_32.S | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/arch/x86/entry/entry_32.S ++++ b/arch/x86/entry/entry_32.S +@@ -278,6 +278,7 @@ ENTRY(schedule_tail_wrapper) + pushl %eax + call schedule_tail + popl %eax ++ CLEAR_CPU_BUFFERS + + FRAME_END + RET +@@ -565,6 +566,7 @@ restore_all: + #endif + .Lrestore_nocheck: + RESTORE_REGS 4 # skip orig_eax/error_code ++ CLEAR_CPU_BUFFERS + .Lirq_return: + INTERRUPT_RETURN + +@@ -1020,6 +1022,7 @@ ENTRY(nmi) + + /* Not on SYSENTER stack. */ + call do_nmi ++ CLEAR_CPU_BUFFERS + jmp .Lrestore_all_notrace + + .Lnmi_from_sysenter_stack: diff --git a/series.conf b/series.conf index c4d5164..4d8948b 100644 --- a/series.conf +++ b/series.conf @@ -64854,6 +64854,7 @@ # tip/tip patches.suse/x86-bugs-Add-asm-helpers-for-executing-VERW.patch patches.suse/x86-entry_64-Add-VERW-just-before-userspace-transition.patch + patches.suse/x86-entry_32-Add-VERW-just-before-userspace-transition.patch # dhowells/linux-fs keys-uefi patches.suse/0001-KEYS-Allow-unrestricted-boot-time-addition-of-keys-t.patch