[edk2-devel] [PATCH 27/35] SecurityPkg: stop abusing EFI_EVENT for protocol notify registration

Laszlo Ersek posted 35 patches 6 years, 4 months ago
[edk2-devel] [PATCH 27/35] SecurityPkg: stop abusing EFI_EVENT for protocol notify registration
Posted by Laszlo Ersek 6 years, 4 months ago
EfiCreateProtocolNotifyEvent() takes a (VOID**) for "Registration",
similarly to gBS->RegisterProtocolNotify(). We should pass the address of
an actual pointer-to-VOID, and not the address of an EFI_EVENT. EFI_EVENT
just happens to be specified as (VOID*), and has nothing to do with the
registration.

This change is a no-op in practice; it's a semantic improvement.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jian Wang <jian.j.wang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---

Notes:
    build-tested only

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

diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.c b/SecurityPkg/HddPassword/HddPasswordDxe.c
index b0d795b6597f..051e64091d7f 100644
--- a/SecurityPkg/HddPassword/HddPasswordDxe.c
+++ b/SecurityPkg/HddPassword/HddPasswordDxe.c
@@ -2770,7 +2770,7 @@ HddPasswordDxeInit (
 {
   EFI_STATUS                     Status;
   HDD_PASSWORD_DXE_PRIVATE_DATA  *Private;
-  EFI_EVENT                      Registration;
+  VOID                           *Registration;
   EFI_EVENT                      EndOfDxeEvent;
   EDKII_VARIABLE_LOCK_PROTOCOL   *VariableLock;
 
-- 
2.19.1.3.g30247aa5d201



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#47414): https://edk2.groups.io/g/devel/message/47414
Mute This Topic: https://groups.io/mt/34180229/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH 27/35] SecurityPkg: stop abusing EFI_EVENT for protocol notify registration
Posted by Philippe Mathieu-Daudé 6 years, 4 months ago
On 9/17/19 9:49 PM, Laszlo Ersek wrote:
> EfiCreateProtocolNotifyEvent() takes a (VOID**) for "Registration",
> similarly to gBS->RegisterProtocolNotify(). We should pass the address of
> an actual pointer-to-VOID, and not the address of an EFI_EVENT. EFI_EVENT
> just happens to be specified as (VOID*), and has nothing to do with the
> registration.
> 
> This change is a no-op in practice; it's a semantic improvement.
> 
> Cc: Chao Zhang <chao.b.zhang@intel.com>
> Cc: Jian Wang <jian.j.wang@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
> 
> Notes:
>     build-tested only
> 
>  SecurityPkg/HddPassword/HddPasswordDxe.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.c b/SecurityPkg/HddPassword/HddPasswordDxe.c
> index b0d795b6597f..051e64091d7f 100644
> --- a/SecurityPkg/HddPassword/HddPasswordDxe.c
> +++ b/SecurityPkg/HddPassword/HddPasswordDxe.c
> @@ -2770,7 +2770,7 @@ HddPasswordDxeInit (
>  {
>    EFI_STATUS                     Status;
>    HDD_PASSWORD_DXE_PRIVATE_DATA  *Private;
> -  EFI_EVENT                      Registration;
> +  VOID                           *Registration;
>    EFI_EVENT                      EndOfDxeEvent;
>    EDKII_VARIABLE_LOCK_PROTOCOL   *VariableLock;
>  
> 

Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#47845): https://edk2.groups.io/g/devel/message/47845
Mute This Topic: https://groups.io/mt/34180229/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH 27/35] SecurityPkg: stop abusing EFI_EVENT for protocol notify registration
Posted by Laszlo Ersek 6 years, 4 months ago
Chao, Jian, Jiewen,

can you please review this patch?

Thanks,
Laszlo


On 09/17/19 21:49, Laszlo Ersek wrote:
> EfiCreateProtocolNotifyEvent() takes a (VOID**) for "Registration",
> similarly to gBS->RegisterProtocolNotify(). We should pass the address of
> an actual pointer-to-VOID, and not the address of an EFI_EVENT. EFI_EVENT
> just happens to be specified as (VOID*), and has nothing to do with the
> registration.
> 
> This change is a no-op in practice; it's a semantic improvement.
> 
> Cc: Chao Zhang <chao.b.zhang@intel.com>
> Cc: Jian Wang <jian.j.wang@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
> 
> Notes:
>     build-tested only
> 
>  SecurityPkg/HddPassword/HddPasswordDxe.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.c b/SecurityPkg/HddPassword/HddPasswordDxe.c
> index b0d795b6597f..051e64091d7f 100644
> --- a/SecurityPkg/HddPassword/HddPasswordDxe.c
> +++ b/SecurityPkg/HddPassword/HddPasswordDxe.c
> @@ -2770,7 +2770,7 @@ HddPasswordDxeInit (
>  {
>    EFI_STATUS                     Status;
>    HDD_PASSWORD_DXE_PRIVATE_DATA  *Private;
> -  EFI_EVENT                      Registration;
> +  VOID                           *Registration;
>    EFI_EVENT                      EndOfDxeEvent;
>    EDKII_VARIABLE_LOCK_PROTOCOL   *VariableLock;
>  
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48105): https://edk2.groups.io/g/devel/message/48105
Mute This Topic: https://groups.io/mt/34180229/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH 27/35] SecurityPkg: stop abusing EFI_EVENT for protocol notify registration
Posted by Laszlo Ersek 6 years, 4 months ago
Pinging SecurityPkg maintainers again, for reviewing this patch.

Thanks
Laszlo

On 09/26/19 14:46, Laszlo Ersek wrote:
> Chao, Jian, Jiewen,
> 
> can you please review this patch?
> 
> Thanks,
> Laszlo
> 
> 
> On 09/17/19 21:49, Laszlo Ersek wrote:
>> EfiCreateProtocolNotifyEvent() takes a (VOID**) for "Registration",
>> similarly to gBS->RegisterProtocolNotify(). We should pass the address of
>> an actual pointer-to-VOID, and not the address of an EFI_EVENT. EFI_EVENT
>> just happens to be specified as (VOID*), and has nothing to do with the
>> registration.
>>
>> This change is a no-op in practice; it's a semantic improvement.
>>
>> Cc: Chao Zhang <chao.b.zhang@intel.com>
>> Cc: Jian Wang <jian.j.wang@intel.com>
>> Cc: Jiewen Yao <jiewen.yao@intel.com>
>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>> ---
>>
>> Notes:
>>     build-tested only
>>
>>  SecurityPkg/HddPassword/HddPasswordDxe.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.c b/SecurityPkg/HddPassword/HddPasswordDxe.c
>> index b0d795b6597f..051e64091d7f 100644
>> --- a/SecurityPkg/HddPassword/HddPasswordDxe.c
>> +++ b/SecurityPkg/HddPassword/HddPasswordDxe.c
>> @@ -2770,7 +2770,7 @@ HddPasswordDxeInit (
>>  {
>>    EFI_STATUS                     Status;
>>    HDD_PASSWORD_DXE_PRIVATE_DATA  *Private;
>> -  EFI_EVENT                      Registration;
>> +  VOID                           *Registration;
>>    EFI_EVENT                      EndOfDxeEvent;
>>    EDKII_VARIABLE_LOCK_PROTOCOL   *VariableLock;
>>  
>>
> 
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48432): https://edk2.groups.io/g/devel/message/48432
Mute This Topic: https://groups.io/mt/34180229/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH 27/35] SecurityPkg: stop abusing EFI_EVENT for protocol notify registration
Posted by Yao, Jiewen 6 years, 4 months ago
Good catch!

Reviewed by: Jiewen Yao <Jiewen.yao@intel.com>

> -----Original Message-----
> From: Laszlo Ersek <lersek@redhat.com>
> Sent: Thursday, October 3, 2019 7:07 PM
> To: Zhang, Chao B <chao.b.zhang@intel.com>; Wang, Jian J
> <jian.j.wang@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
> Cc: edk2-devel-groups-io <devel@edk2.groups.io>
> Subject: Re: [edk2-devel] [PATCH 27/35] SecurityPkg: stop abusing EFI_EVENT
> for protocol notify registration
> 
> Pinging SecurityPkg maintainers again, for reviewing this patch.
> 
> Thanks
> Laszlo
> 
> On 09/26/19 14:46, Laszlo Ersek wrote:
> > Chao, Jian, Jiewen,
> >
> > can you please review this patch?
> >
> > Thanks,
> > Laszlo
> >
> >
> > On 09/17/19 21:49, Laszlo Ersek wrote:
> >> EfiCreateProtocolNotifyEvent() takes a (VOID**) for "Registration",
> >> similarly to gBS->RegisterProtocolNotify(). We should pass the address of
> >> an actual pointer-to-VOID, and not the address of an EFI_EVENT. EFI_EVENT
> >> just happens to be specified as (VOID*), and has nothing to do with the
> >> registration.
> >>
> >> This change is a no-op in practice; it's a semantic improvement.
> >>
> >> Cc: Chao Zhang <chao.b.zhang@intel.com>
> >> Cc: Jian Wang <jian.j.wang@intel.com>
> >> Cc: Jiewen Yao <jiewen.yao@intel.com>
> >> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> >> ---
> >>
> >> Notes:
> >>     build-tested only
> >>
> >>  SecurityPkg/HddPassword/HddPasswordDxe.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.c
> b/SecurityPkg/HddPassword/HddPasswordDxe.c
> >> index b0d795b6597f..051e64091d7f 100644
> >> --- a/SecurityPkg/HddPassword/HddPasswordDxe.c
> >> +++ b/SecurityPkg/HddPassword/HddPasswordDxe.c
> >> @@ -2770,7 +2770,7 @@ HddPasswordDxeInit (
> >>  {
> >>    EFI_STATUS                     Status;
> >>    HDD_PASSWORD_DXE_PRIVATE_DATA  *Private;
> >> -  EFI_EVENT                      Registration;
> >> +  VOID                           *Registration;
> >>    EFI_EVENT                      EndOfDxeEvent;
> >>    EDKII_VARIABLE_LOCK_PROTOCOL   *VariableLock;
> >>
> >>
> >
> >
> > 
> >


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48464): https://edk2.groups.io/g/devel/message/48464
Mute This Topic: https://groups.io/mt/34180229/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH 27/35] SecurityPkg: stop abusing EFI_EVENT for protocol notify registration
Posted by Zhang, Chao B 6 years, 4 months ago
Reviewed-by : Chao Zhang <chao.b.zhang@intel.com>

-----Original Message-----
From: Laszlo Ersek [mailto:lersek@redhat.com] 
Sent: 2019年10月3日 19:07
To: Zhang, Chao B <chao.b.zhang@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
Cc: edk2-devel-groups-io <devel@edk2.groups.io>
Subject: Re: [edk2-devel] [PATCH 27/35] SecurityPkg: stop abusing EFI_EVENT for protocol notify registration

Pinging SecurityPkg maintainers again, for reviewing this patch.

Thanks
Laszlo

On 09/26/19 14:46, Laszlo Ersek wrote:
> Chao, Jian, Jiewen,
> 
> can you please review this patch?
> 
> Thanks,
> Laszlo
> 
> 
> On 09/17/19 21:49, Laszlo Ersek wrote:
>> EfiCreateProtocolNotifyEvent() takes a (VOID**) for "Registration", 
>> similarly to gBS->RegisterProtocolNotify(). We should pass the 
>> address of an actual pointer-to-VOID, and not the address of an 
>> EFI_EVENT. EFI_EVENT just happens to be specified as (VOID*), and has 
>> nothing to do with the registration.
>>
>> This change is a no-op in practice; it's a semantic improvement.
>>
>> Cc: Chao Zhang <chao.b.zhang@intel.com>
>> Cc: Jian Wang <jian.j.wang@intel.com>
>> Cc: Jiewen Yao <jiewen.yao@intel.com>
>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>> ---
>>
>> Notes:
>>     build-tested only
>>
>>  SecurityPkg/HddPassword/HddPasswordDxe.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.c 
>> b/SecurityPkg/HddPassword/HddPasswordDxe.c
>> index b0d795b6597f..051e64091d7f 100644
>> --- a/SecurityPkg/HddPassword/HddPasswordDxe.c
>> +++ b/SecurityPkg/HddPassword/HddPasswordDxe.c
>> @@ -2770,7 +2770,7 @@ HddPasswordDxeInit (  {
>>    EFI_STATUS                     Status;
>>    HDD_PASSWORD_DXE_PRIVATE_DATA  *Private;
>> -  EFI_EVENT                      Registration;
>> +  VOID                           *Registration;
>>    EFI_EVENT                      EndOfDxeEvent;
>>    EDKII_VARIABLE_LOCK_PROTOCOL   *VariableLock;
>>  
>>
> 
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48474): https://edk2.groups.io/g/devel/message/48474
Mute This Topic: https://groups.io/mt/34180229/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-