Skip to content

Commit

Permalink
OvmfPkg: LoadLinuxLib: Fix check for relocatable kernel
Browse files Browse the repository at this point in the history
Boot protocol 2.05 just means that the relocatable_kernel field is present
in the header. We should actually check that it's *set*.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14051 6f19259b-4bc3-4df7-8a09-765794883524
  • Loading branch information
jljusten committed Jan 16, 2013
1 parent aab9212 commit 38851e7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions OvmfPkg/Library/LoadLinuxLib/Linux.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @file
Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
Expand Down Expand Up @@ -60,7 +60,8 @@ LoadLinuxCheckKernelSetup (

if ((Bp->hdr.signature != 0xAA55) || // Check boot sector signature
(Bp->hdr.header != SETUP_HDR) ||
(Bp->hdr.version < 0x205) // We only support relocatable kernels
(Bp->hdr.version < 0x205) || // We only support relocatable kernels
(!Bp->hdr.relocatable_kernel)
) {
return EFI_UNSUPPORTED;
} else {
Expand Down Expand Up @@ -606,7 +607,7 @@ LoadLinux (

Bp = (struct boot_params *) KernelSetup;

if (Bp->hdr.version < 0x205) {
if (Bp->hdr.version < 0x205 || !Bp->hdr.relocatable_kernel) {
//
// We only support relocatable kernels
//
Expand Down

0 comments on commit 38851e7

Please sign in to comment.