summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2024-08-03 08:01:22 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-10-17 15:07:48 +0200
commitcb9134aa0998304a8521eafebe5ee486038698b3 (patch)
tree8dfdc31079fc603903a45be7c957b0d4026e32d0 /arch
parent86da3c79b8893af198e1f82e435e6caa1649c0e7 (diff)
downloadlinux-cb9134aa0998304a8521eafebe5ee486038698b3.tar.gz
linux-cb9134aa0998304a8521eafebe5ee486038698b3.tar.bz2
linux-cb9134aa0998304a8521eafebe5ee486038698b3.zip
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/xen/setup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 1f80dd3a2dd4..629c94d1ab24 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -856,7 +856,7 @@ char * __init xen_memory_setup(void)
* to relocating (and even reusing) pages with kernel text or data.
*/
if (xen_is_e820_reserved(__pa_symbol(_text),
- __pa_symbol(__bss_stop) - __pa_symbol(_text))) {
+ __pa_symbol(_end) - __pa_symbol(_text))) {
xen_raw_console_write("Xen hypervisor allocated kernel memory conflicts with E820 map\n");
BUG();
}