From 38851e781dee0aea1b6dfe11350af5b34ea6d80b Mon Sep 17 00:00:00 2001 From: jljusten Date: Wed, 16 Jan 2013 06:49:27 +0000 Subject: [PATCH] OvmfPkg: LoadLinuxLib: Fix check for relocatable kernel 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 Reviewed-by: Jordan Justen git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14051 6f19259b-4bc3-4df7-8a09-765794883524 --- OvmfPkg/Library/LoadLinuxLib/Linux.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/Library/LoadLinuxLib/Linux.c b/OvmfPkg/Library/LoadLinuxLib/Linux.c index 96c985bc2d..b06285c51a 100644 --- a/OvmfPkg/Library/LoadLinuxLib/Linux.c +++ b/OvmfPkg/Library/LoadLinuxLib/Linux.c @@ -1,6 +1,6 @@ /** @file - Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.
+ Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -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 { @@ -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 // -- 2.39.2