Correct base's type to match its initialization from prot_mode_base and passage to syslinux_memmap_find(). Tested with extlinux. Signed-off-by: Scot Doyle <lkml14 at scotdoyle.com> --- com32/lib/syslinux/load_linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com32/lib/syslinux/load_linux.c b/com32/lib/syslinux/load_linux.c index 06ae2a9..ac73729 100644 --- a/com32/lib/syslinux/load_linux.c +++ b/com32/lib/syslinux/load_linux.c @@ -155,8 +155,8 @@ int bios_boot_linux(void *kernel_buf, size_t kernel_size, char *cmdline) { struct linux_header hdr, *whdr; - size_t real_mode_size, prot_mode_size, base; - addr_t real_mode_base, prot_mode_base, prot_mode_max; + size_t real_mode_size, prot_mode_size; + addr_t real_mode_base, prot_mode_base, prot_mode_max, base; addr_t irf_size; size_t cmdline_size, cmdline_offset; struct setup_data *sdp; -- 2.3.0-rc2
Scot Doyle
2015-Feb-08 03:46 UTC
[syslinux] [PATCH] load_linux: relocate protected-mode code as intended
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 at scotdoyle.com> --- This patch may be applied in addition to "load_linux: correct a type" com32/lib/syslinux/load_linux.c | 1 + 1 file changed, 1 insertion(+) diff --git a/com32/lib/syslinux/load_linux.c b/com32/lib/syslinux/load_linux.c index 06ae2a9..5cecef4 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, -- 2.3.0-rc2
Scot Doyle
2015-Mar-23 14:19 UTC
[syslinux] [PATCH] load_linux: relocate protected-mode code as intended
This patch fixed the Ubuntu 15.04 installer (Launchpad bug #1429323).
Hi, back in February, Scot Doyle proposed two patches: http://www.syslinux.org/archives/2015-February/023209.html http://www.syslinux.org/archives/2015-February/023179.html Since then, the bug fixed by those patches has been identified in Ubuntu, Debian and Tails: https://bugs.launchpad.net/ubuntu/+source/syslinux/+bug/1429323 https://bugs.debian.org/780765 https://labs.riseup.net/code/issues/9044 ... and then, these three distributions have decided to apply Scot's patches, respectively since March, April and May. I'm not aware of any regression reported to any of these distributions since then. Could someone please have a look at these patches, and consider them for inclusion upstream? What can I do to help make this happen? E.g. should I file a ticket in the syslinux bug tracker, so that this stays on someone's radar? Cheers, -- intrigeri
On Sun, Aug 9, 2015 at 3:44 AM, intrigeri via Syslinux <syslinux at zytor.com> wrote:> Hi, > > back in February, Scot Doyle proposed two patches: > > http://www.syslinux.org/archives/2015-February/023209.html0a2dbb339> http://www.syslinux.org/archives/2015-February/023179.html83aad4f6 -- -Gene
Seemingly Similar Threads
- Boot iPXE from syslinux/isolinux
- [PATCH] load_linux: relocate protected-mode code as intended
- Boot iPXE from syslinux/isolinux
- [PATCH] Fix support for Linux kernel images with no protected mode code
- [syslinux:firmware] load_linux: dynamically calculate the cmdline region