Skip to content

Commit 7e09ac2

Browse files
jgross1suryasaimadhu
authored andcommitted
x86: Fix .brk attribute in linker script
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: e32683c ("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
1 parent 38fa547 commit 7e09ac2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/vmlinux.lds.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ SECTIONS
385385
__end_of_kernel_reserve = .;
386386

387387
. = ALIGN(PAGE_SIZE);
388-
.brk (NOLOAD) : AT(ADDR(.brk) - LOAD_OFFSET) {
388+
.brk : AT(ADDR(.brk) - LOAD_OFFSET) {
389389
__brk_base = .;
390390
. += 64 * 1024; /* 64k alignment slop space */
391391
*(.bss..brk) /* areas brk users have reserved */

0 commit comments

Comments
 (0)