* Re: [edk2-devel] [PATCH] BaseStackCheckLib: Fix STACK FAULT message
[not found] <20d06e654e1acf8f910f3c02d2f38ce121f769bf.1696339000.git.jake@nvidia.com>
@ 2023-10-03 16:00 ` Michael D Kinney
2023-10-04 11:12 ` Jake Garver via groups.io
0 siblings, 1 reply; 2+ messages in thread
From: Michael D Kinney @ 2023-10-03 16:00 UTC (permalink / raw)
To: "Name jake@nvidia.com" <Name
Cc: Gao, Liming, Liu, Zhiguang, Jake Garver, Kinney, Michael D
I think the macro RETURN_ADDRESS from Base.h should be used instead of
direct use of the builtin.
Mike
> -----Original Message-----
> From: Name jake@nvidia.com <Name jake@nvidia.com>
> Sent: Tuesday, October 3, 2023 6:20 AM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>; Jake
> Garver <jake@nvidia.com>
> Subject: [PATCH] BaseStackCheckLib: Fix STACK FAULT message
>
> From: Jake Garver <jake@nvidia.com>
>
> __builtin_return_address returns a pointer, not a string. Fix the STACK
> FAULT message in BaseStackCheckLib appropriately.
>
> Signed-off-by: Jake Garver <jake@nvidia.com>
> ---
> MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c
> b/MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c
> index 0d2918668e..3b970391b7 100644
> --- a/MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c
> +++ b/MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c
> @@ -34,7 +34,7 @@ __stack_chk_fail (
> {
> UINT8 DebugPropertyMask;
>
> - DEBUG ((DEBUG_ERROR, "STACK FAULT: Buffer Overflow in function %a.\n",
> __builtin_return_address (0)));
> + DEBUG ((DEBUG_ERROR, "STACK FAULT: Buffer Overflow at 0x%p.\n",
> __builtin_return_address (0)));
>
> //
> // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings even if
> --
> 2.34.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109294): https://edk2.groups.io/g/devel/message/109294
Mute This Topic: https://groups.io/mt/101736789/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [edk2-devel] [PATCH] BaseStackCheckLib: Fix STACK FAULT message
2023-10-03 16:00 ` [edk2-devel] [PATCH] BaseStackCheckLib: Fix STACK FAULT message Michael D Kinney
@ 2023-10-04 11:12 ` Jake Garver via groups.io
0 siblings, 0 replies; 2+ messages in thread
From: Jake Garver via groups.io @ 2023-10-04 11:12 UTC (permalink / raw)
To: Kinney, Michael D, "Name jake@nvidia.com" <Name
Cc: Gao, Liming, Liu, Zhiguang
[-- Attachment #1: Type: text/plain, Size: 2469 bytes --]
Thanks. I'll submit a v2 with that change.
________________________________
From: Kinney, Michael D <michael.d.kinney@intel.com>
Sent: Tuesday, October 3, 2023 12:00 PM
To: Name jake@nvidia.com <Name jake@nvidia.com>; devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Gao, Liming <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>; Jake Garver <jake@nvidia.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Subject: RE: [PATCH] BaseStackCheckLib: Fix STACK FAULT message
External email: Use caution opening links or attachments
I think the macro RETURN_ADDRESS from Base.h should be used instead of
direct use of the builtin.
Mike
> -----Original Message-----
> From: Name jake@nvidia.com <Name jake@nvidia.com>
> Sent: Tuesday, October 3, 2023 6:20 AM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>; Jake
> Garver <jake@nvidia.com>
> Subject: [PATCH] BaseStackCheckLib: Fix STACK FAULT message
>
> From: Jake Garver <jake@nvidia.com>
>
> __builtin_return_address returns a pointer, not a string. Fix the STACK
> FAULT message in BaseStackCheckLib appropriately.
>
> Signed-off-by: Jake Garver <jake@nvidia.com>
> ---
> MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c
> b/MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c
> index 0d2918668e..3b970391b7 100644
> --- a/MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c
> +++ b/MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c
> @@ -34,7 +34,7 @@ __stack_chk_fail (
> {
> UINT8 DebugPropertyMask;
>
> - DEBUG ((DEBUG_ERROR, "STACK FAULT: Buffer Overflow in function %a.\n",
> __builtin_return_address (0)));
> + DEBUG ((DEBUG_ERROR, "STACK FAULT: Buffer Overflow at 0x%p.\n",
> __builtin_return_address (0)));
>
> //
> // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings even if
> --
> 2.34.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109313): https://edk2.groups.io/g/devel/message/109313
Mute This Topic: https://groups.io/mt/101736789/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
[-- Attachment #2: Type: text/html, Size: 4134 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-10-04 11:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20d06e654e1acf8f910f3c02d2f38ce121f769bf.1696339000.git.jake@nvidia.com>
2023-10-03 16:00 ` [edk2-devel] [PATCH] BaseStackCheckLib: Fix STACK FAULT message Michael D Kinney
2023-10-04 11:12 ` Jake Garver via groups.io
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox