File tboot-bsc#1207833-copy-mbi.patch of Package tboot

Index: tboot-1.11.9/tboot/common/loader.c
===================================================================
--- tboot-1.11.9.orig/tboot/common/loader.c
+++ tboot-1.11.9/tboot/common/loader.c
@@ -1100,15 +1100,21 @@ void move_modules(loader_ctx *lctx)
 
     if ( below_tboot(lowest) )
         from = lowest;
-    else
+
+    /*
+     * if MBI is below tboot & the lowest module, make sure it gets
+     * copied, too!
+     */
+    if ( below_tboot((unsigned long)lctx->addr) &&
+        (unsigned long)lctx->addr < lowest )
+    {
+        from = (unsigned long)lctx->addr;
+    }
+
+    if (from == 0)
     {
-        if ( below_tboot((unsigned long)lctx->addr) )
-            from = (unsigned long)lctx->addr;
-        else
-        {
-            printk(TBOOT_INFO"No module below tboot, all good.\n");
-            return;
-        }
+        printk(TBOOT_INFO"No module below tboot, all good.\n");
+        return;
     }
 
     unsigned long highest = get_highest_mod_end(lctx);
openSUSE Build Service is sponsored by