Skip to content

Commit 909d89d

Browse files
committed
grub-core/loader/slaunch/i386_linux.c: check MLE's UUID
This allows to catch use of an image built without Slaunch early. Signed-off-by: Sergii Dmytruk <[email protected]>
1 parent 278a598 commit 909d89d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

grub-core/loader/slaunch/i386_linux.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ grub_sl_find_kernel_info (struct grub_slaunch_params *slparams, grub_file_t kern
121121
goto fail;
122122
}
123123

124+
if (grub_memcmp (mle_hdr.uuid, GRUB_TXT_MLE_UUID, 16) != 0)
125+
{
126+
grub_dprintf ("linux", "Not an MLE header at %llu\n",
127+
(unsigned long long)slparams->mle_header_offset + real_size + GRUB_DISK_SECTOR_SIZE);
128+
grub_error (GRUB_ERR_BAD_OS, N_("failed to locate MLE header"));
129+
goto fail;
130+
}
131+
124132
slparams->mle_entry = mle_hdr.entry_point;
125133

126134
return GRUB_ERR_NONE;

0 commit comments

Comments
 (0)