This patch fixes a bug in determine_multiboot_type() that causes an
infinite loop while searching for a multiboot header.
diff --git a/tboot/common/loader.c b/tboot/common/loader.c
index 0a35545..cdc1c6d 100644
--- a/tboot/common/loader.c
+++ b/tboot/common/loader.c
@@ -1164,14 +1164,14 @@ determine_multiboot_type(void *image)
      */
     int result = MB_NONE;
     void *walker;
-    for (walker = image; walker < walker + MULTIBOOT_HEADER_SEARCH_LIMIT;
+    for (walker = image; walker < image + MULTIBOOT_HEADER_SEARCH_LIMIT;
          walker += sizeof(uint32_t)){
         if (*((uint32_t *)walker) == MULTIBOOT_HEADER_MAGIC){
             result += MB1_ONLY;
             break;
         }
     }
-    for (walker = image; walker < walker + MB2_HEADER_SEARCH_LIMIT;
+    for (walker = image; walker < image + MB2_HEADER_SEARCH_LIMIT;
          walker += sizeof(uint64_t)){
         if (*((uint32_t *)walker) == MB2_HEADER_MAGIC){
             result += MB2_ONLY;
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
tboot-devel mailing list
tboot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tboot-devel

Reply via email to