]> git.baikalelectronics.ru Git - kernel.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)
committerBorislav Petkov <bp@suse.de>
Fri, 1 Jul 2022 09:12:43 +0000 (11:12 +0200)
commit6afd636caaadc42073d74c4d88a654646a22d7c7
treea78ec4ad54498d4f57fba9dd167ebfc6db3a86ef
parent9f89c64452a62e9845e3741058ce24605fed9bfc
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: 03f0f3fc6253 ("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
arch/x86/kernel/vmlinux.lds.S