public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: "Zhang, Chao B" <chao.b.zhang@intel.com>,
	"Zeng, Star" <star.zeng@intel.com>,
	"Marc-André Lureau" <marcandre.lureau@gmail.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Yao, Jiewen" <jiewen.yao@intel.com>
Subject: Re: [PATCH v2 1/1] SecurityPkg: fix ZeroMem HashInterfaceHob
Date: Wed, 7 Mar 2018 21:55:09 +0100	[thread overview]
Message-ID: <580b566a-5087-b9a3-1e0e-0ef2cd2426fb@redhat.com> (raw)
In-Reply-To: <FF72C7E4248F3C4E9BDF19D4918E90F249661FD3@shsmsx102.ccr.corp.intel.com>

On 03/07/18 16:35, Zhang, Chao B wrote:
> Star:
>    Why do we need to add HashInterfaceHob->SupportedHashMask = 0?  HashInterfaceHob is internally maintained and accessed by HashLibRouterPei.
> There is no impact to leave the value after module has been re-shadowed.

There seems to be no functional requirement for clearing the
SupportedHashMask field, except the original (buggy) ZeroMem() call
looked like it *intended* to clear the field. So now that we have fixed
the buffer overflow, we should decide whether we want to stick with the
original intent (that would mean continuing to clear the field, one way
or another), or to depart from the original intent -- but that would
merit a comment in the code (or, it would have deserved a comment in the
commit message).

In short, it's not great to do two independent things in the same patch,
namely (a) fix the buffer overflow, (b) silently diverge from the
original intent, even if that's functionally justified.

Such changes should be split to two patches, or else explained in detail.

Thanks
Laszlo


      reply	other threads:[~2018-03-07 20:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07 11:24 [PATCH v2 1/1] SecurityPkg: fix ZeroMem HashInterfaceHob marcandre.lureau
2018-03-07 14:55 ` Marc-André Lureau
2018-03-07 15:09   ` Zeng, Star
2018-03-07 15:35     ` Zhang, Chao B
2018-03-07 20:55       ` Laszlo Ersek [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=580b566a-5087-b9a3-1e0e-0ef2cd2426fb@redhat.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