:: commit 7d66f97c0240d32fbe78e820cc469769c8c1b1f5

Mintsuki <mintsuki@protonmail.com> — 2026-02-07 05:38

parents: c3b686bbbe

protos/multiboot2: Reject relocatable tag with align=0

diff --git a/common/protos/multiboot2.c b/common/protos/multiboot2.c
index c8dedf6d..80cc9f7b 100644
--- a/common/protos/multiboot2.c
+++ b/common/protos/multiboot2.c
@@ -350,6 +350,10 @@ noreturn void multiboot2_load(char *config, char* cmdline) {
     int64_t reloc_slide = 0;
 
     if (has_reloc_header) {
+        if (reloc_tag.align == 0) {
+            panic(true, "multiboot2: Relocatable tag has align=0");
+        }
+
         bool reloc_ascend;
         uint64_t relocated_base;
 
tab: 248 wrap: offon