aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
authorScot Doyle <lkml14@scotdoyle.com>2015-04-18 07:11:07 -0400
committerGene Cumm <gene.cumm@gmail.com>2015-04-18 13:02:46 -0400
commit0a2dbb3392ee710838bea6bda80d4daad6b54780 (patch)
tree28ace617ec8a80a31a06c23ab2cfdd146aed074c /com32
parentf1e95ca49902b5eda4c02275a69152d4834882d6 (diff)
downloadsyslinux-0a2dbb3392ee710838bea6bda80d4daad6b54780.tar.gz
syslinux-0a2dbb3392ee710838bea6bda80d4daad6b54780.tar.xz
syslinux-0a2dbb3392ee710838bea6bda80d4daad6b54780.zip
com32/lib/syslinux/load_linux.c: update prot_mode_base
If the kernel is relocatable and the protected mode code will not fit in the initially determined location, that code will be moved to the next available location. However, beginning with commit 8f470e7b, the code is moved to the initially determined location instead of the next available location because prot_mode_base is no longer updated to the correct location. Since whdr->code32_start is updated, it is pointing to the wrong execution start location, random code is executed and the machine is rebooted. Restore the old behavior by assigning prot_mode_base the value of base. Tested on a machine that exposed this behavior. Signed-off-by: Scot Doyle <lkml14@scotdoyle.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Diffstat (limited to 'com32')
-rw-r--r--com32/lib/syslinux/load_linux.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/com32/lib/syslinux/load_linux.c b/com32/lib/syslinux/load_linux.c
index ac737293..fc7f04f0 100644
--- a/com32/lib/syslinux/load_linux.c
+++ b/com32/lib/syslinux/load_linux.c
@@ -323,6 +323,7 @@ int bios_boot_linux(void *kernel_buf, size_t kernel_size,
}
whdr->code32_start += base - prot_mode_base;
+ prot_mode_base = base;
/* Real mode code */
if (syslinux_memmap_find(amap, &real_mode_base,