From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"Yao, Jiewen" <jiewen.yao@intel.com>,
"Xu, Min M" <min.m.xu@intel.com>
Cc: "Aktas, Erdem" <erdemaktas@google.com>,
James Bottomley <jejb@linux.ibm.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Tom Lendacky <thomas.lendacky@amd.com>
Subject: Re: [edk2-devel] [PATCH V1 1/1] OvmfPkg/PlatformInitLib: Add check to NvVarStoreFV HeaderLength
Date: Fri, 2 Dec 2022 01:34:00 +0000 [thread overview]
Message-ID: <MW4PR11MB5872A0A00C346992AF82EB048C179@MW4PR11MB5872.namprd11.prod.outlook.com> (raw)
In-Reply-To: <172C97603AF93BB4.27320@groups.io>
Merged https://github.com/tianocore/edk2/pull/3694
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Yao,
> Jiewen
> Sent: Thursday, December 1, 2022 2:27 PM
> To: Xu, Min M <min.m.xu@intel.com>; devel@edk2.groups.io
> Cc: Aktas, Erdem <erdemaktas@google.com>; James Bottomley
> <jejb@linux.ibm.com>; Gerd Hoffmann <kraxel@redhat.com>; Tom
> Lendacky <thomas.lendacky@amd.com>
> Subject: Re: [edk2-devel] [PATCH V1 1/1] OvmfPkg/PlatformInitLib: Add
> check to NvVarStoreFV HeaderLength
>
> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
>
> > -----Original Message-----
> > From: Xu, Min M <min.m.xu@intel.com>
> > Sent: Sunday, November 27, 2022 3:00 PM
> > To: devel@edk2.groups.io
> > Cc: Xu, Min M <min.m.xu@intel.com>; Aktas, Erdem
> > <erdemaktas@google.com>; James Bottomley <jejb@linux.ibm.com>;
> Yao,
> > Jiewen <jiewen.yao@intel.com>; Gerd Hoffmann <kraxel@redhat.com>;
> > Tom Lendacky <thomas.lendacky@amd.com>
> > Subject: [PATCH V1 1/1] OvmfPkg/PlatformInitLib: Add check to
> > NvVarStoreFV HeaderLength
> >
> > From: Min M Xu <min.m.xu@intel.com>
> >
> > There should be a check that the FV HeaderLength cannot be an odd
> > number. Otherwise in the following CalculateSum16 there would be an
> > ASSERT.
> >
> > In
> ValidateFvHeader@QemuFlashFvbServicesRuntimeDxe/FwBlockServices.c
> > there a is similar check to the FwVolHeader->HeaderLength.
> >
> > Cc: Erdem Aktas <erdemaktas@google.com>
> > Cc: James Bottomley <jejb@linux.ibm.com>
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > Cc: Tom Lendacky <thomas.lendacky@amd.com>
> > Signed-off-by: Min Xu <min.m.xu@intel.com>
> > ---
> > OvmfPkg/Library/PlatformInitLib/Platform.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/OvmfPkg/Library/PlatformInitLib/Platform.c
> > b/OvmfPkg/Library/PlatformInitLib/Platform.c
> > index 2582689ffe35..77f22de046f2 100644
> > --- a/OvmfPkg/Library/PlatformInitLib/Platform.c
> > +++ b/OvmfPkg/Library/PlatformInitLib/Platform.c
> > @@ -653,6 +653,7 @@ PlatformValidateNvVarStore (
> > (!CompareGuid (&FvHdrGUID, &NvVarStoreFvHeader-
> >FileSystemGuid))
> > ||
> > (NvVarStoreFvHeader->Signature != EFI_FVH_SIGNATURE) ||
> > (NvVarStoreFvHeader->Attributes != 0x4feff) ||
> > + ((NvVarStoreFvHeader->HeaderLength & 0x01) != 0) ||
> > (NvVarStoreFvHeader->Revision != EFI_FVH_REVISION) ||
> > (NvVarStoreFvHeader->FvLength != NvVarStoreSize)
> > )
> > --
> > 2.29.2.windows.2
>
>
>
>
>
prev parent reply other threads:[~2022-12-02 1:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-27 7:00 [PATCH V1 1/1] OvmfPkg/PlatformInitLib: Add check to NvVarStoreFV HeaderLength Min Xu
2022-12-01 6:26 ` Yao, Jiewen
[not found] ` <172C97603AF93BB4.27320@groups.io>
2022-12-02 1:34 ` Yao, Jiewen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MW4PR11MB5872A0A00C346992AF82EB048C179@MW4PR11MB5872.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox