]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86: Fix .brk attribute in linker script
authorJuergen Gross <jgross@suse.com>
Thu, 30 Jun 2022 07:14:41 +0000 (09:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Nov 2023 16:26:44 +0000 (17:26 +0100)
commit65fd21aa3805f8e2ede23c6cdd144defeea12eb8
tree3ad5ae35cfbe4e6a44bbb1807c7a66fee8099950
parentd4c8bf5635c4bedaf2470761ced1f502b2d5434e
x86: Fix .brk attribute in linker script

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