]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Apr 2024 06:53:28 +0000 (08:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Apr 2024 06:53:28 +0000 (08:53 +0200)
added patches:
gcc-plugins-stackleak-avoid-.head.text-section.patch

queue-6.6/gcc-plugins-stackleak-avoid-.head.text-section.patch [new file with mode: 0644]
queue-6.6/series

diff --git a/queue-6.6/gcc-plugins-stackleak-avoid-.head.text-section.patch b/queue-6.6/gcc-plugins-stackleak-avoid-.head.text-section.patch
new file mode 100644 (file)
index 0000000..9e66c78
--- /dev/null
@@ -0,0 +1,36 @@
+From e7d24c0aa8e678f41457d1304e2091cac6fd1a2e Mon Sep 17 00:00:00 2001
+From: Ard Biesheuvel <ardb@kernel.org>
+Date: Thu, 28 Mar 2024 07:42:57 +0100
+Subject: gcc-plugins/stackleak: Avoid .head.text section
+
+From: Ard Biesheuvel <ardb@kernel.org>
+
+commit e7d24c0aa8e678f41457d1304e2091cac6fd1a2e upstream.
+
+The .head.text section carries the startup code that runs with the MMU
+off or with a translation of memory that deviates from the ordinary one.
+So avoid instrumentation with the stackleak plugin, which already avoids
+.init.text and .noinstr.text entirely.
+
+Fixes: 48204aba801f1b51 ("x86/sme: Move early SME kernel encryption handling into .head.text")
+Reported-by: kernel test robot <oliver.sang@intel.com>
+Closes: https://lore.kernel.org/oe-lkp/202403221630.2692c998-oliver.sang@intel.com
+Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
+Link: https://lore.kernel.org/r/20240328064256.2358634-2-ardb+git@google.com
+Signed-off-by: Kees Cook <keescook@chromium.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ scripts/gcc-plugins/stackleak_plugin.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/scripts/gcc-plugins/stackleak_plugin.c
++++ b/scripts/gcc-plugins/stackleak_plugin.c
+@@ -467,6 +467,8 @@ static bool stackleak_gate(void)
+                       return false;
+               if (STRING_EQUAL(section, ".entry.text"))
+                       return false;
++              if (STRING_EQUAL(section, ".head.text"))
++                      return false;
+       }
+       return track_frame_size >= 0;
index b9dd53b8b1d5f55eed6059054ff1c71c85d9a9e3..e23c588c8bb2b91d74c74466a9527fd567e950cf 100644 (file)
@@ -101,3 +101,4 @@ modpost-fix-null-pointer-dereference.patch
 drivers-nvme-add-quirks-for-device-126f-2262.patch
 fbmon-prevent-division-by-zero-in-fb_videomode_from_.patch
 alsa-hda-realtek-add-quirks-for-some-clevo-laptops.patch
+gcc-plugins-stackleak-avoid-.head.text-section.patch