Skip to content

Commit fac1bce

Browse files
committed
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: 808fdb7 ("xen: check for kernel memory conflicting with memory layout") Signed-off-by: Juergen Gross <[email protected]> Tested-by: Marek Marczykowski-Górecki <[email protected]> Reviewed-by: Jan Beulich <[email protected]> Signed-off-by: Juergen Gross <[email protected]>
1 parent da3ea35 commit fac1bce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/xen/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ char * __init xen_memory_setup(void)
825825
* to relocating (and even reusing) pages with kernel text or data.
826826
*/
827827
if (xen_is_e820_reserved(__pa_symbol(_text),
828-
__pa_symbol(__bss_stop) - __pa_symbol(_text))) {
828+
__pa_symbol(_end) - __pa_symbol(_text))) {
829829
xen_raw_console_write("Xen hypervisor allocated kernel memory conflicts with E820 map\n");
830830
BUG();
831831
}

0 commit comments

Comments
 (0)