]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xen: use correct end address of kernel for conflict checking
authorJuergen Gross <jgross@suse.com>
Sat, 3 Aug 2024 06:01:22 +0000 (08:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:10:55 +0000 (15:10 +0200)
commited3e8cc9159ae956fb0ac858496f66c803d5bbc8
tree69bb526ed8cdca289c2f3b23a9100b3317b34838
parenta8906615f7c87003c1c579d9888e995290227a0d
xen: use correct end address of kernel for conflict checking

[ Upstream commit fac1bceeeb04886fc2ee952672e6e6c85ce41dca ]

When running as a Xen PV dom0 the kernel is loaded by the hypervisor
using a different memory map than that of the host. In order to
minimize the required changes in the kernel, the kernel adapts its
memory map to that of the host. In order to do that it is checking
for conflicts of its load address with the host memory map.

Unfortunately the tested memory range does not include the .brk
area, which might result in crashes or memory corruption when this
area does conflict with the memory map of the host.

Fix the test by using the _end label instead of __bss_stop.

Fixes: 808fdb71936c ("xen: check for kernel memory conflicting with memory layout")
Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/xen/setup.c