aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2013-01-25 13:32:23 +0000
committerMatt Fleming <matt.fleming@intel.com>2013-01-25 13:38:09 +0000
commit5d6e34ffc660136e5f5a0e54be65ee55c1adf00c (patch)
treeedc499fd912d2cda7cb417d4e126714df33665bd
parentaa925098a5887a2925e7b6396b3483ed86c69cc0 (diff)
downloadefilinux-5d6e34ffc660136e5f5a0e54be65ee55c1adf00c.tar.gz
bzimage: Check that the kernel is relocatable
It's not enough to check that bzImage header supports the 'relocatable_kernel' field, we also need to make sure that the field is set. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r--loaders/bzimage/bzimage.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/loaders/bzimage/bzimage.c b/loaders/bzimage/bzimage.c
index efdb884..d683eae 100644
--- a/loaders/bzimage/bzimage.c
+++ b/loaders/bzimage/bzimage.c
@@ -248,6 +248,12 @@ load_kernel(EFI_HANDLE image, CHAR16 *name, char *_cmdline)
goto out;
}
+ if (!buf->hdr.relocatable_kernel) {
+ Print(L"Expected relocatable kernel");
+ err = EFI_INVALID_PARAMETER;
+ goto out;
+ }
+
if (buf->hdr.version >= 0x20a) {
pref_address = buf->hdr.pref_address;
init_size = buf->hdr.init_size;