# HG changeset patch
# User Alex Olson <alex.ol...@starlab.io>
# Date 1634323050 18000
#      Fri Oct 15 13:37:30 2021 -0500
# Node ID 06433602ffe048ceb946d538d51620ae8152c93d
# Parent  f3574795bf2ecbd0e717268f9cb9ccc8982f1861
Ensure that growth of Multiboot tags does not go beyond original area

The grow_mb2_tag() function can only rearrange Multiboot content
within the area originally allocated by the parent bootloader (Grub).

This revision ensures that boot will not continue if the expansion of
a tag would overflow the original area.

In practice, small expansions as a result of tboot added content
are normally "paid for" through tboot's removal of other tags.

Signed-off-by: Alex Olson <alex.ol...@starlab.io>

diff -r f3574795bf2e -r 06433602ffe0 tboot/common/loader.c
--- a/tboot/common/loader.c     Tue Oct 19 13:53:09 2021 -0500
+++ b/tboot/common/loader.c     Fri Oct 15 13:37:30 2021 -0500
@@ -375,6 +375,7 @@
     if (growth > slack){
         printk(TBOOT_ERR"YIKES!!! grow_mb2_tag slack %d < growth %d\n",
                slack, growth);
+        apply_policy(TB_ERR_FATAL);
     }
 
     /* now we copy down from the bottom, going up */


_______________________________________________
tboot-devel mailing list
tboot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tboot-devel

Reply via email to