]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Nov 2023 17:57:10 +0000 (18:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Nov 2023 17:57:10 +0000 (18:57 +0100)
added patches:
x86-fix-.brk-attribute-in-linker-script.patch

queue-5.10/series
queue-5.10/x86-fix-.brk-attribute-in-linker-script.patch [new file with mode: 0644]

index 9493c23d7ecb00adbaa053fc5c1ed089adb8bcf2..2bafabe41b38aca29fe1d2bf65b46c3512b80f40 100644 (file)
@@ -57,3 +57,4 @@ rpmsg-fix-kfree-of-static-memory-on-setting-driver_override.patch
 rpmsg-fix-calling-device_lock-on-non-initialized-device.patch
 rpmsg-glink-release-driver_override.patch
 rpmsg-fix-possible-refcount-leak-in-rpmsg_register_device_override.patch
+x86-fix-.brk-attribute-in-linker-script.patch
diff --git a/queue-5.10/x86-fix-.brk-attribute-in-linker-script.patch b/queue-5.10/x86-fix-.brk-attribute-in-linker-script.patch
new file mode 100644 (file)
index 0000000..c0ff3f8
--- /dev/null
@@ -0,0 +1,45 @@
+From 7e09ac27f43b382f5fe9bb7c7f4c465ece1f8a23 Mon Sep 17 00:00:00 2001
+From: Juergen Gross <jgross@suse.com>
+Date: Thu, 30 Jun 2022 09:14:41 +0200
+Subject: x86: Fix .brk attribute in linker script
+
+From: Juergen Gross <jgross@suse.com>
+
+commit 7e09ac27f43b382f5fe9bb7c7f4c465ece1f8a23 upstream.
+
+Commit in Fixes added the "NOLOAD" attribute to the .brk section as a
+"failsafe" measure.
+
+Unfortunately, this leads to the linker no longer covering the .brk
+section in a program header, resulting in the kernel loader not knowing
+that the memory for the .brk section must be reserved.
+
+This has led to crashes when loading the kernel as PV dom0 under Xen,
+but other scenarios could be hit by the same problem (e.g. in case an
+uncompressed kernel is used and the initrd is placed directly behind
+it).
+
+So drop the "NOLOAD" attribute. This has been verified to correctly
+cover the .brk section by a program header of the resulting ELF file.
+
+Fixes: e32683c6f7d2 ("x86/mm: Fix RESERVE_BRK() for older binutils")
+Signed-off-by: Juergen Gross <jgross@suse.com>
+Signed-off-by: Borislav Petkov <bp@suse.de>
+Reviewed-by: Josh Poimboeuf <jpoimboe@kernel.org>
+Link: https://lore.kernel.org/r/20220630071441.28576-4-jgross@suse.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/x86/kernel/vmlinux.lds.S |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/kernel/vmlinux.lds.S
++++ b/arch/x86/kernel/vmlinux.lds.S
+@@ -411,7 +411,7 @@ SECTIONS
+       __end_of_kernel_reserve = .;
+       . = ALIGN(PAGE_SIZE);
+-      .brk (NOLOAD) : AT(ADDR(.brk) - LOAD_OFFSET) {
++      .brk : AT(ADDR(.brk) - LOAD_OFFSET) {
+               __brk_base = .;
+               . += 64 * 1024;         /* 64k alignment slop space */
+               *(.bss..brk)            /* areas brk users have reserved */