public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] NetworkPkg/TlsAuthConfigDxe: Declare EFIAPI for the ChooseFile handler
@ 2017-01-16  6:30 Gary Lin
  2017-01-17  3:47 ` Fu, Siyuan
  2017-01-18  5:00 ` Wu, Jiaxin
  0 siblings, 2 replies; 4+ messages in thread
From: Gary Lin @ 2017-01-16  6:30 UTC (permalink / raw)
  To: edk2-devel; +Cc: Siyuan Fu, Jiaxin Wu

The ChooseFile handler, UpdateCAFromFile, has to be EFIAPI or gcc would
use the wrong ABI and cause the crash of the firmware. This commit also
removes the unnecessary type casting in ChooseFile.

Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
---
 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c b/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
index 5f04503887..fedfb01be9 100644
--- a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
+++ b/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
@@ -1218,6 +1218,7 @@ UpdatePage(
   @retval FALSE  Not exit caller function.
 **/
 BOOLEAN
+EFIAPI
 UpdateCAFromFile (
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
   )
@@ -1728,7 +1729,7 @@ TlsAuthConfigAccessCallback (
       CleanUpPage (LabelId, Private);
       break;
     case KEY_TLS_AUTH_CONFIG_ENROLL_CERT_FROM_FILE:
-      ChooseFile( NULL, NULL, (CHOOSE_HANDLER) UpdateCAFromFile, &File);
+      ChooseFile( NULL, NULL, UpdateCAFromFile, &File);
       break;
 
     case KEY_TLS_AUTH_CONFIG_VALUE_SAVE_AND_EXIT:
-- 
2.11.0



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

* Re: [PATCH] NetworkPkg/TlsAuthConfigDxe: Declare EFIAPI for the ChooseFile handler
  2017-01-16  6:30 [PATCH] NetworkPkg/TlsAuthConfigDxe: Declare EFIAPI for the ChooseFile handler Gary Lin
@ 2017-01-17  3:47 ` Fu, Siyuan
  2017-01-17  4:49   ` Wu, Jiaxin
  2017-01-18  5:00 ` Wu, Jiaxin
  1 sibling, 1 reply; 4+ messages in thread
From: Fu, Siyuan @ 2017-01-17  3:47 UTC (permalink / raw)
  To: Gary Lin, edk2-devel@lists.01.org; +Cc: Wu, Jiaxin

Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Gary Lin
Sent: 2017年1月16日 14:30
To: edk2-devel@lists.01.org
Cc: Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [edk2] [PATCH] NetworkPkg/TlsAuthConfigDxe: Declare EFIAPI for the ChooseFile handler

The ChooseFile handler, UpdateCAFromFile, has to be EFIAPI or gcc would use the wrong ABI and cause the crash of the firmware. This commit also removes the unnecessary type casting in ChooseFile.

Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
---
 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c b/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
index 5f04503887..fedfb01be9 100644
--- a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
+++ b/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
@@ -1218,6 +1218,7 @@ UpdatePage(
   @retval FALSE  Not exit caller function.
 **/
 BOOLEAN
+EFIAPI
 UpdateCAFromFile (
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
   )
@@ -1728,7 +1729,7 @@ TlsAuthConfigAccessCallback (
       CleanUpPage (LabelId, Private);
       break;
     case KEY_TLS_AUTH_CONFIG_ENROLL_CERT_FROM_FILE:
-      ChooseFile( NULL, NULL, (CHOOSE_HANDLER) UpdateCAFromFile, &File);
+      ChooseFile( NULL, NULL, UpdateCAFromFile, &File);
       break;
 
     case KEY_TLS_AUTH_CONFIG_VALUE_SAVE_AND_EXIT:
--
2.11.0

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

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

* Re: [PATCH] NetworkPkg/TlsAuthConfigDxe: Declare EFIAPI for the ChooseFile handler
  2017-01-17  3:47 ` Fu, Siyuan
@ 2017-01-17  4:49   ` Wu, Jiaxin
  0 siblings, 0 replies; 4+ messages in thread
From: Wu, Jiaxin @ 2017-01-17  4:49 UTC (permalink / raw)
  To: Fu, Siyuan, Gary Lin, edk2-devel@lists.01.org

Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>


> -----Original Message-----
> From: Fu, Siyuan
> Sent: Tuesday, January 17, 2017 11:47 AM
> To: Gary Lin <glin@suse.com>; edk2-devel@lists.01.org
> Cc: Wu, Jiaxin <jiaxin.wu@intel.com>
> Subject: RE: [edk2] [PATCH] NetworkPkg/TlsAuthConfigDxe: Declare EFIAPI for
> the ChooseFile handler
> 
> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
> 
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Gary
> Lin
> Sent: 2017年1月16日 14:30
> To: edk2-devel@lists.01.org
> Cc: Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
> Subject: [edk2] [PATCH] NetworkPkg/TlsAuthConfigDxe: Declare EFIAPI for the
> ChooseFile handler
> 
> The ChooseFile handler, UpdateCAFromFile, has to be EFIAPI or gcc would use
> the wrong ABI and cause the crash of the firmware. This commit also removes
> the unnecessary type casting in ChooseFile.
> 
> Cc: Siyuan Fu <siyuan.fu@intel.com>
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Gary Lin <glin@suse.com>
> ---
>  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
> b/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
> index 5f04503887..fedfb01be9 100644
> --- a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
> +++ b/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
> @@ -1218,6 +1218,7 @@ UpdatePage(
>    @retval FALSE  Not exit caller function.
>  **/
>  BOOLEAN
> +EFIAPI
>  UpdateCAFromFile (
>    IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
>    )
> @@ -1728,7 +1729,7 @@ TlsAuthConfigAccessCallback (
>        CleanUpPage (LabelId, Private);
>        break;
>      case KEY_TLS_AUTH_CONFIG_ENROLL_CERT_FROM_FILE:
> -      ChooseFile( NULL, NULL, (CHOOSE_HANDLER) UpdateCAFromFile, &File);
> +      ChooseFile( NULL, NULL, UpdateCAFromFile, &File);
>        break;
> 
>      case KEY_TLS_AUTH_CONFIG_VALUE_SAVE_AND_EXIT:
> --
> 2.11.0
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel

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

* Re: [PATCH] NetworkPkg/TlsAuthConfigDxe: Declare EFIAPI for the ChooseFile handler
  2017-01-16  6:30 [PATCH] NetworkPkg/TlsAuthConfigDxe: Declare EFIAPI for the ChooseFile handler Gary Lin
  2017-01-17  3:47 ` Fu, Siyuan
@ 2017-01-18  5:00 ` Wu, Jiaxin
  1 sibling, 0 replies; 4+ messages in thread
From: Wu, Jiaxin @ 2017-01-18  5:00 UTC (permalink / raw)
  To: Gary Lin, edk2-devel@lists.01.org; +Cc: Fu, Siyuan

Commit version:

https://github.com/tianocore/edk2/commit/7be6e6776253d3638f03375e346e978228af5edb

Thanks,
Jiaxin


> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Gary
> Lin
> Sent: Monday, January 16, 2017 2:30 PM
> To: edk2-devel@lists.01.org
> Cc: Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
> Subject: [edk2] [PATCH] NetworkPkg/TlsAuthConfigDxe: Declare EFIAPI for the
> ChooseFile handler
> 
> The ChooseFile handler, UpdateCAFromFile, has to be EFIAPI or gcc would
> use the wrong ABI and cause the crash of the firmware. This commit also
> removes the unnecessary type casting in ChooseFile.
> 
> Cc: Siyuan Fu <siyuan.fu@intel.com>
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Gary Lin <glin@suse.com>
> ---
>  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
> b/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
> index 5f04503887..fedfb01be9 100644
> --- a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
> +++ b/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
> @@ -1218,6 +1218,7 @@ UpdatePage(
>    @retval FALSE  Not exit caller function.
>  **/
>  BOOLEAN
> +EFIAPI
>  UpdateCAFromFile (
>    IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
>    )
> @@ -1728,7 +1729,7 @@ TlsAuthConfigAccessCallback (
>        CleanUpPage (LabelId, Private);
>        break;
>      case KEY_TLS_AUTH_CONFIG_ENROLL_CERT_FROM_FILE:
> -      ChooseFile( NULL, NULL, (CHOOSE_HANDLER) UpdateCAFromFile, &File);
> +      ChooseFile( NULL, NULL, UpdateCAFromFile, &File);
>        break;
> 
>      case KEY_TLS_AUTH_CONFIG_VALUE_SAVE_AND_EXIT:
> --
> 2.11.0
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


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

end of thread, other threads:[~2017-01-18  5:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-16  6:30 [PATCH] NetworkPkg/TlsAuthConfigDxe: Declare EFIAPI for the ChooseFile handler Gary Lin
2017-01-17  3:47 ` Fu, Siyuan
2017-01-17  4:49   ` Wu, Jiaxin
2017-01-18  5:00 ` Wu, Jiaxin

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