public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
	"Wu, Hao A" <hao.a.wu@intel.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: "Wang, Jian J" <jian.j.wang@intel.com>
Subject: Re: [edk2-devel] [PATCH v2] MdeModulePkg/DxeCapsuleLibFmp: avoid ESRT accesses at runtime
Date: Mon, 22 Apr 2019 22:37:04 +0000	[thread overview]
Message-ID: <E92EE9817A31E24EB0585FDF735412F5B9C9CB90@ORSMSX113.amr.corp.intel.com> (raw)
In-Reply-To: <CAKv+Gu9uxXJMGMX0FG3Hx1Z-dukw2EtWYsJAh4iYcY5PLvj69A@mail.gmail.com>

Ard,

I only see one potential issue.

The size of the buffer copied is based on the FwResourceCount field.
The actual size of based on the FwResourceCountMax field.  Your patch
does not set FwResourceCountMax to FwResourceCount, so this may confuse
the OS consumers that may think the buffer allocated for ESRT is larger
that is actually is.

  ///
  /// The number of firmware resources in the table, must not be zero.
  ///
  UINT32                     FwResourceCount;
  ///
  /// The maximum number of resource array entries that can be within the table
  /// without reallocating the table, must not be zero.
  ///
  UINT32                     FwResourceCountMax;

The simplest fix is to use FwResourceCountMax instead of FwResourceCount 
for the copy size.  The other option is to set FwResourceCountMax to
FwResourceCountMax after the copy.

The rest of the patch looks good.  With one of the two changes above:

Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>

Mike

> -----Original Message-----
> From: devel@edk2.groups.io
> [mailto:devel@edk2.groups.io] On Behalf Of Ard
> Biesheuvel
> Sent: Monday, April 22, 2019 3:03 PM
> To: Wu, Hao A <hao.a.wu@intel.com>
> Cc: devel@edk2.groups.io; Wang, Jian J
> <jian.j.wang@intel.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>
> Subject: Re: [edk2-devel] [PATCH v2]
> MdeModulePkg/DxeCapsuleLibFmp: avoid ESRT accesses at
> runtime
> 
> On Mon, 22 Apr 2019 at 09:14, Wu, Hao A
> <hao.a.wu@intel.com> wrote:
> >
> > > -----Original Message-----
> > > From: devel@edk2.groups.io
> [mailto:devel@edk2.groups.io] On Behalf Of Ard
> > > Biesheuvel
> > > Sent: Saturday, April 20, 2019 6:35 PM
> > > To: devel@edk2.groups.io
> > > Cc: Wu, Hao A; Wang, Jian J; Kinney, Michael D; Ard
> Biesheuvel
> > > Subject: [edk2-devel] [PATCH v2]
> MdeModulePkg/DxeCapsuleLibFmp: avoid
> > > ESRT accesses at runtime
> >
> > Hello Ard,
> >
> > It seems to me v2 patch makes a copy of the ESRT for
> runtime usage (rather
> > than avoid using ESRT), so the title of the commit
> may need update as
> > well.
> >
> > Could you help to update the patch subject when you
> push the change?
> >
> > Other than that, the patch looks good to me. But I
> would like to see if
> > Mike has additional comments on this:
> >
> > Acked-by: Hao Wu <hao.a.wu@intel.com>
> >
> 
> Thanks Hao. I will modify the subject to 'clone ESRT
> for runtime access'
> 
> Mike: any comments?
> 
> 


  reply	other threads:[~2019-04-22 22:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-20 10:34 [PATCH v2] MdeModulePkg/DxeCapsuleLibFmp: avoid ESRT accesses at runtime Ard Biesheuvel
2019-04-22  7:14 ` [edk2-devel] " Wu, Hao A
2019-04-22 22:03   ` Ard Biesheuvel
2019-04-22 22:37     ` Michael D Kinney [this message]
2019-04-22 22:40       ` Ard Biesheuvel
2019-04-22 23:02         ` Michael D Kinney
2019-04-23 16:52           ` Ard Biesheuvel

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=E92EE9817A31E24EB0585FDF735412F5B9C9CB90@ORSMSX113.amr.corp.intel.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