syslinux.git-0a2dbb3.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From 0a2dbb3392ee710838bea6bda80d4daad6b54780 Mon Sep 17 00:00:00 2001
  2. From: Scot Doyle <lkml14@scotdoyle.com>
  3. Date: Sat, 18 Apr 2015 07:11:07 -0400
  4. Subject: [PATCH] com32/lib/syslinux/load_linux.c: update prot_mode_base
  5. If the kernel is relocatable and the protected mode code will not fit
  6. in the initially determined location, that code will be moved to the
  7. next available location. However, beginning with commit 8f470e7b, the
  8. code is moved to the initially determined location instead of the next
  9. available location because prot_mode_base is no longer updated to the
  10. correct location. Since whdr->code32_start is updated, it is pointing
  11. to the wrong execution start location, random code is executed and
  12. the machine is rebooted.
  13. Restore the old behavior by assigning prot_mode_base the value of
  14. base. Tested on a machine that exposed this behavior.
  15. Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
  16. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
  17. ---
  18. com32/lib/syslinux/load_linux.c | 1 +
  19. 1 file changed, 1 insertion(+)
  20. diff --git a/com32/lib/syslinux/load_linux.c b/com32/lib/syslinux/load_linux.c
  21. index ac73729..fc7f04f 100644
  22. --- a/com32/lib/syslinux/load_linux.c
  23. +++ b/com32/lib/syslinux/load_linux.c
  24. @@ -323,6 +323,7 @@ int bios_boot_linux(void *kernel_buf, size_t kernel_size,
  25. }
  26. whdr->code32_start += base - prot_mode_base;
  27. + prot_mode_base = base;
  28. /* Real mode code */
  29. if (syslinux_memmap_find(amap, &real_mode_base,
  30. --
  31. 2.7.4.GIT