From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by mx.groups.io with SMTP id smtpd.web12.2472.1629575786491718618 for ; Sat, 21 Aug 2021 12:56:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.de header.s=2017 header.b=XDaI4/vq; spf=pass (domain: posteo.de, ip: 185.67.36.65, mailfrom: mhaeuser@posteo.de) Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id E68FF240027 for ; Sat, 21 Aug 2021 21:56:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1629575784; bh=7hK2KNXcdjHzLTNT9iJZsneAfMPElMDO8bIIH6G3ED4=; h=From:To:Cc:Subject:Date:From; b=XDaI4/vqqBCt2qw0/GjvP8/7XcXW8O5sXb9Uai/SvWUOGuPLQZb1TkZNBdvUhIvHg 3iX865cQtAmPJVimuHguhBcEBy93vrYEbYg06RbI45hAH51pjzgLxspOEGcoQ9SPmp Lnv0mPp6HXspRBwEbR/VOr8PRr0jEDIHugnND6T7tLRp9xIOVsSMc6Da4pkx03wqZ/ qjffyhw5smzY8nu5Qj9hqVMIC/Rly8wx0+eMCXbMO+0ccX+YEb2WQvIzxt76yn6Lom SwFjuIB5LEP34DOl54sDIX+oCrgTE2ARNznb+sDhNsXx6bFWyEny9ZkflX3kBdgqV1 tFNa6g1iebqkQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4GsTlr332fz9rxL; Sat, 21 Aug 2021 21:56:24 +0200 (CEST) From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Eric Dong , Ray Ni , Vitaly Cheptsov Subject: [PATCH 4/5] MdeModulePkg/PiSmmIpl: Disallow stripped Image relocations Date: Sat, 21 Aug 2021 19:55:52 +0000 Message-Id: In-Reply-To: <6baa44c6ee3ead5e4ffdefd5fdd3961323c323d0.1629575593.git.mhaeuser@posteo.de> References: <6baa44c6ee3ead5e4ffdefd5fdd3961323c323d0.1629575593.git.mhaeuser@posteo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable The SMM stack does not support loading Images to preferred addresses in any way. Add checks that Image relocations have not been stripped. Cc: Jian J Wang Cc: Hao A Wu Cc: Eric Dong Cc: Ray Ni Cc: Vitaly Cheptsov Signed-off-by: Marvin H=C3=A4user --- MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c b/MdeModulePkg/Core/PiS= mmCore/PiSmmIpl.c index 599a0cd01d80..d70b6e8ff46d 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c @@ -1049,6 +1049,15 @@ ExecuteSmmCoreFromSmram ( if (EFI_ERROR (Status)) {=0D return Status;=0D }=0D +=0D + //=0D + // Stripped Image relocations are not supported for both fixed-address a= nd=0D + // dynamic loading.=0D + //=0D + if (ImageContext.RelocationsStripped) {=0D + return EFI_UNSUPPORTED;=0D + }=0D +=0D //=0D // if Loading module at Fixed Address feature is enabled, the SMM core d= river will be loaded to=0D // the address assigned by build tool.=0D --=20 2.31.1