]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Jul 2022 08:59:47 +0000 (10:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Jul 2022 08:59:47 +0000 (10:59 +0200)
added patches:
x86-use-mindirect-branch-cs-prefix-for-retpoline-builds.patch

queue-5.15/series
queue-5.15/x86-use-mindirect-branch-cs-prefix-for-retpoline-builds.patch [new file with mode: 0644]

index c5871c13c85eb0ca96659992f9117b84876a031a..785294903810ddc465ff3b7657662d51f2b954fb 100644 (file)
@@ -86,3 +86,4 @@ tools-arch-x86-sync-the-msr-index.h-copy-with-the-kernel-sources.patch
 tools-headers-cpufeatures-sync-with-the-kernel-sources.patch
 x86-bugs-remove-apostrophe-typo.patch
 um-add-missing-apply_returns.patch
+x86-use-mindirect-branch-cs-prefix-for-retpoline-builds.patch
diff --git a/queue-5.15/x86-use-mindirect-branch-cs-prefix-for-retpoline-builds.patch b/queue-5.15/x86-use-mindirect-branch-cs-prefix-for-retpoline-builds.patch
new file mode 100644 (file)
index 0000000..21f3053
--- /dev/null
@@ -0,0 +1,42 @@
+From 68cf4f2a72ef8786e6b7af6fd9a89f27ac0f520d Mon Sep 17 00:00:00 2001
+From: Peter Zijlstra <peterz@infradead.org>
+Date: Fri, 19 Nov 2021 17:50:25 +0100
+Subject: x86: Use -mindirect-branch-cs-prefix for RETPOLINE builds
+
+From: Peter Zijlstra <peterz@infradead.org>
+
+commit 68cf4f2a72ef8786e6b7af6fd9a89f27ac0f520d upstream.
+
+In order to further enable commit:
+
+  bbe2df3f6b6d ("x86/alternative: Try inline spectre_v2=retpoline,amd")
+
+add the new GCC flag -mindirect-branch-cs-prefix:
+
+  https://gcc.gnu.org/g:2196a681d7810ad8b227bf983f38ba716620545e
+  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102952
+  https://bugs.llvm.org/show_bug.cgi?id=52323
+
+to RETPOLINE=y builds. This should allow fully inlining retpoline,amd
+for GCC builds.
+
+Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Signed-off-by: Borislav Petkov <bp@suse.de>
+Reviewed-by: Kees Cook <keescook@chromium.org>
+Acked-by: Nick Desaulniers <ndesaulniers@google.com>
+Link: https://lkml.kernel.org/r/20211119165630.276205624@infradead.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Makefile |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/Makefile
++++ b/Makefile
+@@ -687,6 +687,7 @@ endif
+ ifdef CONFIG_CC_IS_GCC
+ RETPOLINE_CFLAGS      := $(call cc-option,-mindirect-branch=thunk-extern -mindirect-branch-register)
++RETPOLINE_CFLAGS      += $(call cc-option,-mindirect-branch-cs-prefix)
+ RETPOLINE_VDSO_CFLAGS := $(call cc-option,-mindirect-branch=thunk-inline -mindirect-branch-register)
+ endif
+ ifdef CONFIG_CC_IS_CLANG