Package: syslinux
Version: 3:6.03+dfsg-5
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu vivid ubuntu-patch

Hi Daniel,

In Ubuntu, my attention was recently called to a problem with syslinux 6.03
not booting correctly on Chromebooks.  To fix this problem, I've applied two
patches to the Ubuntu package taken from the upstream mailing list.  You may
find it beneficial to apply these patches to the Debian package as well.

The changelog for the upload to Ubuntu is:

  * debian/patches/relocatable-kernel-loads.patch: load_linux: relocate
    protected-mode code as intended.  Thanks to Scot Doyle
    <lkm...@scotdoyle.com>.  Closes LP: #1429323.
  * debian/patches/load_linux-correct-type.patch: load_linux: correct a
    type.  Thanks to Scot Doyle <lkm...@scotdoyle.com>.

Thanks for considering the patch.
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
diff -Nru syslinux-6.03+dfsg/debian/changelog syslinux-6.03+dfsg/debian/changelog
diff -Nru syslinux-6.03+dfsg/debian/patches/load_linux-correct-type.patch syslinux-6.03+dfsg/debian/patches/load_linux-correct-type.patch
--- syslinux-6.03+dfsg/debian/patches/load_linux-correct-type.patch	1969-12-31 16:00:00.000000000 -0800
+++ syslinux-6.03+dfsg/debian/patches/load_linux-correct-type.patch	2015-03-18 16:11:07.000000000 -0700
@@ -0,0 +1,29 @@
+Author: Scot Doyle <lkm...@scotdoyle.com>
+Description: load_linux: correct a type
+ 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 <lkm...@scotdoyle.com>
+Forwarded: http://www.syslinux.org/archives/2015-February/023179.html
+
+---
+ 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
+
diff -Nru syslinux-6.03+dfsg/debian/patches/relocatable-kernel-loads.patch syslinux-6.03+dfsg/debian/patches/relocatable-kernel-loads.patch
--- syslinux-6.03+dfsg/debian/patches/relocatable-kernel-loads.patch	1969-12-31 16:00:00.000000000 -0800
+++ syslinux-6.03+dfsg/debian/patches/relocatable-kernel-loads.patch	2015-03-18 16:10:47.000000000 -0700
@@ -0,0 +1,38 @@
+Author: Scot Doyle <lkm...@scotdoyle.com>
+Description: 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 <lkm...@scotdoyle.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1429323
+Forwarded: http://www.syslinux.org/archives/2015-February/023209.html
+
+---
+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
+
diff -Nru syslinux-6.03+dfsg/debian/patches/series syslinux-6.03+dfsg/debian/patches/series
--- syslinux-6.03+dfsg/debian/patches/series	2014-12-07 11:51:56.000000000 -0800
+++ syslinux-6.03+dfsg/debian/patches/series	2015-03-18 16:09:21.000000000 -0700
@@ -2,3 +2,5 @@
 0002-gfxboot-menu-label.patch
 0003-extlinux-manpage.patch
 0004-gnu-efi-git.patch
+relocatable-kernel-loads.patch
+load_linux-correct-type.patch

Reply via email to