:: commit 72764fe04071757cfe88fb9e322253688f17d176

mintsuki <mintsuki@protonmail.com> — 2021-12-06 18:10

parents: c3fbba91c7

stivale2: Only test stack validity if in top 2GiB

diff --git a/stage23/protos/stivale2.c b/stage23/protos/stivale2.c
index b237b310..02487035 100644
--- a/stage23/protos/stivale2.c
+++ b/stage23/protos/stivale2.c
@@ -273,7 +273,7 @@ failed_to_load_header_section:
         print("stivale2: WARNING: Requested stack is not 16-byte aligned\n");
     }
 
-    if (stivale2_hdr.stack != 0 && ranges != NULL) {
+    if (stivale2_hdr.stack >= 0xffffffff80000000 && ranges != NULL) {
         bool stack_valid = false;
 
         for (size_t i = 0; i < ranges_count; i++) {
tab: 248 wrap: offon