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)
committerJuergen Gross <jgross@suse.com>
Tue, 10 Sep 2024 08:07:04 +0000 (10:07 +0200)
commitfac1bceeeb04886fc2ee952672e6e6c85ce41dca
tree57609fe97f03f1a7df9df842344e625320d3908e
parentda3ea35007d0af457a0afc87e84fddaebc4e0b63
xen: use correct end address of kernel for conflict checking

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>
arch/x86/xen/setup.c