]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* loader/multiboot_elfxx.c (grub_multiboot_load_elfXX) [__mips]: Check
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 31 May 2010 18:23:51 +0000 (20:23 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 31 May 2010 18:23:51 +0000 (20:23 +0200)
64-bit address as signed on MIPS.

ChangeLog
loader/multiboot_elfxx.c

index 5072a6026c58bd0e512eb88f0784b19c3446261f..c6edd3ac3b4f644d36fb928f3fc53210901689ed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-31  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * loader/multiboot_elfxx.c (grub_multiboot_load_elfXX) [__mips]: Check
+       64-bit address as signed on MIPS.
+
 2010-05-28  Colin Watson  <cjwatson@ubuntu.com>
 
        * configure.ac: AC_PROG_LEX sets LEX to ":" if lex is missing, not
index 92a52d3a86da188e901dbdf49ed28a4331a6f0af..78b7c542c86feef3693b4a9d233984959d3d2663 100644 (file)
@@ -74,7 +74,11 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, void *buffer)
   if (ehdr->e_phoff + ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH)
     return grub_error (GRUB_ERR_BAD_OS, "program header at a too high offset");
 
-#ifdef MULTIBOOT_LOAD_ELF64
+#if defined (MULTIBOOT_LOAD_ELF64) && defined (__mips)
+  /* We still in 32-bit mode.  */
+  if (ehdr->e_entry < 0xffffffff80000000ULL)
+    return grub_error (GRUB_ERR_BAD_OS, "invalid entry point for ELF64");
+#else
   /* We still in 32-bit mode.  */
   if (ehdr->e_entry > 0xffffffff)
     return grub_error (GRUB_ERR_BAD_OS, "invalid entry point for ELF64");