public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH EDK2 v2 1/1] SecurityPkg/FvReportPei: remove redundant sizeof
  2021-04-14  1:43 [PATCH EDK2 v2 0/1] " wenyi,xie
@ 2021-04-14  1:43 ` wenyi,xie
  0 siblings, 0 replies; 7+ messages in thread
From: wenyi,xie @ 2021-04-14  1:43 UTC (permalink / raw)
  To: devel, jiewen.yao, jian.j.wang, lersek; +Cc: songdongkuang, xiewenyi2

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3333

In function InstallPreHashFvPpi, when calculating the size
of struct HASH_INFO,sizeof is used twice. This bug does
not lead to buffer overflow, "sizeof (HASH_INFO)" is 4,
whereas "sizeof (sizeof (HASH_INFO))" is 4 or 8.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
---
 SecurityPkg/FvReportPei/FvReportPei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SecurityPkg/FvReportPei/FvReportPei.c b/SecurityPkg/FvReportPei/FvReportPei.c
index d709760ea3ce..e82413e090c0 100644
--- a/SecurityPkg/FvReportPei/FvReportPei.c
+++ b/SecurityPkg/FvReportPei/FvReportPei.c
@@ -67,7 +67,7 @@ InstallPreHashFvPpi (
   HASH_INFO                                         *HashInfo;
 
   PpiSize = sizeof (EDKII_PEI_FIRMWARE_VOLUME_INFO_PREHASHED_FV_PPI)
-            + sizeof (sizeof (HASH_INFO))
+            + sizeof (HASH_INFO)
             + HashSize;
 
   PreHashedFvPpi = AllocatePool (PpiSize);
-- 
2.20.1.windows.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH EDK2 v2 0/1] SecurityPkg/FvReportPei: remove redundant sizeof
@ 2021-07-29  7:45 wenyi,xie
  2021-07-29  7:45 ` [PATCH EDK2 v2 1/1] " wenyi,xie
  0 siblings, 1 reply; 7+ messages in thread
From: wenyi,xie @ 2021-07-29  7:45 UTC (permalink / raw)
  To: devel, jian.j.wang, hao.a.wu; +Cc: songdongkuang, xiewenyi2

Main Changes since v1 :
Change commit message.

Wenyi Xie (1):
  SecurityPkg/FvReportPei: remove redundant sizeof

 SecurityPkg/FvReportPei/FvReportPei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.20.1.windows.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH EDK2 v2 1/1] SecurityPkg/FvReportPei: remove redundant sizeof
  2021-07-29  7:45 [PATCH EDK2 v2 0/1] SecurityPkg/FvReportPei: remove redundant sizeof wenyi,xie
@ 2021-07-29  7:45 ` wenyi,xie
  2021-07-29  8:00   ` wenyi,xie
  2021-07-29  8:23   ` [edk2-devel] " Wu, Hao A
  0 siblings, 2 replies; 7+ messages in thread
From: wenyi,xie @ 2021-07-29  7:45 UTC (permalink / raw)
  To: devel, jian.j.wang, hao.a.wu
  Cc: songdongkuang, xiewenyi2, Jiewen Yao, Laszlo Ersek

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3333

In function InstallPreHashFvPpi, when calculating the size
of struct HASH_INFO,sizeof is used twice. This bug does
not lead to buffer overflow, "sizeof (HASH_INFO)" is 4,
whereas "sizeof (sizeof (HASH_INFO))" is 4 or 8.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
---
 SecurityPkg/FvReportPei/FvReportPei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SecurityPkg/FvReportPei/FvReportPei.c b/SecurityPkg/FvReportPei/FvReportPei.c
index d709760ea3ce..e82413e090c0 100644
--- a/SecurityPkg/FvReportPei/FvReportPei.c
+++ b/SecurityPkg/FvReportPei/FvReportPei.c
@@ -67,7 +67,7 @@ InstallPreHashFvPpi (
   HASH_INFO                                         *HashInfo;
 
   PpiSize = sizeof (EDKII_PEI_FIRMWARE_VOLUME_INFO_PREHASHED_FV_PPI)
-            + sizeof (sizeof (HASH_INFO))
+            + sizeof (HASH_INFO)
             + HashSize;
 
   PreHashedFvPpi = AllocatePool (PpiSize);
-- 
2.20.1.windows.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH EDK2 v2 1/1] SecurityPkg/FvReportPei: remove redundant sizeof
  2021-07-29  7:45 ` [PATCH EDK2 v2 1/1] " wenyi,xie
@ 2021-07-29  8:00   ` wenyi,xie
  2021-07-29  8:23   ` [edk2-devel] " Wu, Hao A
  1 sibling, 0 replies; 7+ messages in thread
From: wenyi,xie @ 2021-07-29  8:00 UTC (permalink / raw)
  To: devel, jian.j.wang, hao.a.wu; +Cc: songdongkuang, Jiewen Yao, Laszlo Ersek

Execuse me, I made a mistake and sent the wrong patch. Please ignore it.

Thanks
Wenyi

On 2021/7/29 15:45, Wenyi Xie wrote:
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3333
> 
> In function InstallPreHashFvPpi, when calculating the size
> of struct HASH_INFO,sizeof is used twice. This bug does
> not lead to buffer overflow, "sizeof (HASH_INFO)" is 4,
> whereas "sizeof (sizeof (HASH_INFO))" is 4 or 8.
> 
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> ---
>  SecurityPkg/FvReportPei/FvReportPei.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/SecurityPkg/FvReportPei/FvReportPei.c b/SecurityPkg/FvReportPei/FvReportPei.c
> index d709760ea3ce..e82413e090c0 100644
> --- a/SecurityPkg/FvReportPei/FvReportPei.c
> +++ b/SecurityPkg/FvReportPei/FvReportPei.c
> @@ -67,7 +67,7 @@ InstallPreHashFvPpi (
>    HASH_INFO                                         *HashInfo;
>  
>    PpiSize = sizeof (EDKII_PEI_FIRMWARE_VOLUME_INFO_PREHASHED_FV_PPI)
> -            + sizeof (sizeof (HASH_INFO))
> +            + sizeof (HASH_INFO)
>              + HashSize;
>  
>    PreHashedFvPpi = AllocatePool (PpiSize);
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [PATCH EDK2 v2 1/1] SecurityPkg/FvReportPei: remove redundant sizeof
  2021-07-29  7:45 ` [PATCH EDK2 v2 1/1] " wenyi,xie
  2021-07-29  8:00   ` wenyi,xie
@ 2021-07-29  8:23   ` Wu, Hao A
  2021-07-29  8:24     ` Yao, Jiewen
  2021-07-29  8:24     ` Wu, Hao A
  1 sibling, 2 replies; 7+ messages in thread
From: Wu, Hao A @ 2021-07-29  8:23 UTC (permalink / raw)
  To: devel@edk2.groups.io, xiewenyi2@huawei.com, Wang, Jian J
  Cc: songdongkuang@huawei.com, Yao, Jiewen, Laszlo Ersek

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> wenyi,xie via groups.io
> Sent: Thursday, July 29, 2021 3:45 PM
> To: devel@edk2.groups.io; Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A
> <hao.a.wu@intel.com>
> Cc: songdongkuang@huawei.com; xiewenyi2@huawei.com; Yao, Jiewen
> <jiewen.yao@intel.com>; Laszlo Ersek <lersek@redhat.com>
> Subject: [edk2-devel] [PATCH EDK2 v2 1/1] SecurityPkg/FvReportPei: remove
> redundant sizeof
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3333
> 
> In function InstallPreHashFvPpi, when calculating the size
> of struct HASH_INFO,sizeof is used twice. This bug does
> not lead to buffer overflow, "sizeof (HASH_INFO)" is 4,
> whereas "sizeof (sizeof (HASH_INFO))" is 4 or 8.


Thanks.
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>

I will wait a couple days before merging to see if any additional comment from other reviewers.

Best Regards,
Hao Wu


> 
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> ---
>  SecurityPkg/FvReportPei/FvReportPei.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/SecurityPkg/FvReportPei/FvReportPei.c
> b/SecurityPkg/FvReportPei/FvReportPei.c
> index d709760ea3ce..e82413e090c0 100644
> --- a/SecurityPkg/FvReportPei/FvReportPei.c
> +++ b/SecurityPkg/FvReportPei/FvReportPei.c
> @@ -67,7 +67,7 @@ InstallPreHashFvPpi (
>    HASH_INFO                                         *HashInfo;
> 
>    PpiSize = sizeof
> (EDKII_PEI_FIRMWARE_VOLUME_INFO_PREHASHED_FV_PPI)
> -            + sizeof (sizeof (HASH_INFO))
> +            + sizeof (HASH_INFO)
>              + HashSize;
> 
>    PreHashedFvPpi = AllocatePool (PpiSize);
> --
> 2.20.1.windows.1
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [PATCH EDK2 v2 1/1] SecurityPkg/FvReportPei: remove redundant sizeof
  2021-07-29  8:23   ` [edk2-devel] " Wu, Hao A
@ 2021-07-29  8:24     ` Yao, Jiewen
  2021-07-29  8:24     ` Wu, Hao A
  1 sibling, 0 replies; 7+ messages in thread
From: Yao, Jiewen @ 2021-07-29  8:24 UTC (permalink / raw)
  To: Wu, Hao A, devel@edk2.groups.io, xiewenyi2@huawei.com,
	Wang, Jian J
  Cc: songdongkuang@huawei.com, Laszlo Ersek

I think  I have given R-B. If no, then
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>

> -----Original Message-----
> From: Wu, Hao A <hao.a.wu@intel.com>
> Sent: Thursday, July 29, 2021 4:23 PM
> To: devel@edk2.groups.io; xiewenyi2@huawei.com; Wang, Jian J
> <jian.j.wang@intel.com>
> Cc: songdongkuang@huawei.com; Yao, Jiewen <jiewen.yao@intel.com>; Laszlo
> Ersek <lersek@redhat.com>
> Subject: RE: [edk2-devel] [PATCH EDK2 v2 1/1] SecurityPkg/FvReportPei: remove
> redundant sizeof
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> > wenyi,xie via groups.io
> > Sent: Thursday, July 29, 2021 3:45 PM
> > To: devel@edk2.groups.io; Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A
> > <hao.a.wu@intel.com>
> > Cc: songdongkuang@huawei.com; xiewenyi2@huawei.com; Yao, Jiewen
> > <jiewen.yao@intel.com>; Laszlo Ersek <lersek@redhat.com>
> > Subject: [edk2-devel] [PATCH EDK2 v2 1/1] SecurityPkg/FvReportPei: remove
> > redundant sizeof
> >
> > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3333
> >
> > In function InstallPreHashFvPpi, when calculating the size
> > of struct HASH_INFO,sizeof is used twice. This bug does
> > not lead to buffer overflow, "sizeof (HASH_INFO)" is 4,
> > whereas "sizeof (sizeof (HASH_INFO))" is 4 or 8.
> 
> 
> Thanks.
> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
> 
> I will wait a couple days before merging to see if any additional comment from
> other reviewers.
> 
> Best Regards,
> Hao Wu
> 
> 
> >
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > Cc: Jian J Wang <jian.j.wang@intel.com>
> > Cc: Laszlo Ersek <lersek@redhat.com>
> > Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
> > Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> > ---
> >  SecurityPkg/FvReportPei/FvReportPei.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/SecurityPkg/FvReportPei/FvReportPei.c
> > b/SecurityPkg/FvReportPei/FvReportPei.c
> > index d709760ea3ce..e82413e090c0 100644
> > --- a/SecurityPkg/FvReportPei/FvReportPei.c
> > +++ b/SecurityPkg/FvReportPei/FvReportPei.c
> > @@ -67,7 +67,7 @@ InstallPreHashFvPpi (
> >    HASH_INFO                                         *HashInfo;
> >
> >    PpiSize = sizeof
> > (EDKII_PEI_FIRMWARE_VOLUME_INFO_PREHASHED_FV_PPI)
> > -            + sizeof (sizeof (HASH_INFO))
> > +            + sizeof (HASH_INFO)
> >              + HashSize;
> >
> >    PreHashedFvPpi = AllocatePool (PpiSize);
> > --
> > 2.20.1.windows.1
> >
> >
> >
> > 
> >


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [PATCH EDK2 v2 1/1] SecurityPkg/FvReportPei: remove redundant sizeof
  2021-07-29  8:23   ` [edk2-devel] " Wu, Hao A
  2021-07-29  8:24     ` Yao, Jiewen
@ 2021-07-29  8:24     ` Wu, Hao A
  1 sibling, 0 replies; 7+ messages in thread
From: Wu, Hao A @ 2021-07-29  8:24 UTC (permalink / raw)
  To: devel@edk2.groups.io, xiewenyi2@huawei.com, Wang, Jian J
  Cc: songdongkuang@huawei.com, Yao, Jiewen, Laszlo Ersek

> -----Original Message-----
> From: Wu, Hao A
> Sent: Thursday, July 29, 2021 4:23 PM
> To: devel@edk2.groups.io; xiewenyi2@huawei.com; Wang, Jian J
> <jian.j.wang@intel.com>
> Cc: songdongkuang@huawei.com; Yao, Jiewen <jiewen.yao@intel.com>;
> Laszlo Ersek <lersek@redhat.com>
> Subject: RE: [edk2-devel] [PATCH EDK2 v2 1/1] SecurityPkg/FvReportPei:
> remove redundant sizeof
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> > wenyi,xie via groups.io
> > Sent: Thursday, July 29, 2021 3:45 PM
> > To: devel@edk2.groups.io; Wang, Jian J <jian.j.wang@intel.com>; Wu,
> > Hao A <hao.a.wu@intel.com>
> > Cc: songdongkuang@huawei.com; xiewenyi2@huawei.com; Yao, Jiewen
> > <jiewen.yao@intel.com>; Laszlo Ersek <lersek@redhat.com>
> > Subject: [edk2-devel] [PATCH EDK2 v2 1/1] SecurityPkg/FvReportPei:
> > remove redundant sizeof
> >
> > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3333
> >
> > In function InstallPreHashFvPpi, when calculating the size of struct
> > HASH_INFO,sizeof is used twice. This bug does not lead to buffer
> > overflow, "sizeof (HASH_INFO)" is 4, whereas "sizeof (sizeof
> > (HASH_INFO))" is 4 or 8.
> 
> 
> Thanks.
> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
> 
> I will wait a couple days before merging to see if any additional comment
> from other reviewers.


Really sorry, please ignore the previous mail sent (giving the Reviewed-by tag).
It was sent by accident. Withdraw my R-b tag for this patch.

Best Regards,
Hao Wu


> 
> Best Regards,
> Hao Wu
> 
> 
> >
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > Cc: Jian J Wang <jian.j.wang@intel.com>
> > Cc: Laszlo Ersek <lersek@redhat.com>
> > Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
> > Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> > ---
> >  SecurityPkg/FvReportPei/FvReportPei.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/SecurityPkg/FvReportPei/FvReportPei.c
> > b/SecurityPkg/FvReportPei/FvReportPei.c
> > index d709760ea3ce..e82413e090c0 100644
> > --- a/SecurityPkg/FvReportPei/FvReportPei.c
> > +++ b/SecurityPkg/FvReportPei/FvReportPei.c
> > @@ -67,7 +67,7 @@ InstallPreHashFvPpi (
> >    HASH_INFO                                         *HashInfo;
> >
> >    PpiSize = sizeof
> > (EDKII_PEI_FIRMWARE_VOLUME_INFO_PREHASHED_FV_PPI)
> > -            + sizeof (sizeof (HASH_INFO))
> > +            + sizeof (HASH_INFO)
> >              + HashSize;
> >
> >    PreHashedFvPpi = AllocatePool (PpiSize);
> > --
> > 2.20.1.windows.1
> >
> >
> >
> > 
> >


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-07-29  8:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-29  7:45 [PATCH EDK2 v2 0/1] SecurityPkg/FvReportPei: remove redundant sizeof wenyi,xie
2021-07-29  7:45 ` [PATCH EDK2 v2 1/1] " wenyi,xie
2021-07-29  8:00   ` wenyi,xie
2021-07-29  8:23   ` [edk2-devel] " Wu, Hao A
2021-07-29  8:24     ` Yao, Jiewen
2021-07-29  8:24     ` Wu, Hao A
  -- strict thread matches above, loose matches on Subject: below --
2021-04-14  1:43 [PATCH EDK2 v2 0/1] " wenyi,xie
2021-04-14  1:43 ` [PATCH EDK2 v2 1/1] " wenyi,xie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox