mbox series

[edk2,0/2] Clear frame pointer in startup code on AARCH64 systems

Message ID 20181116225558.27720-1-ard.biesheuvel@linaro.org
Headers show
Series Clear frame pointer in startup code on AARCH64 systems | expand

Message

Ard Biesheuvel Nov. 16, 2018, 10:55 p.m. UTC
The backtrace code on AARCH64 does not sanitize the frame pointer values
it pulls of the stack when attempting to do a backtrace, and so junk left
in the frame pointer register may result in a recursive exception and a
truncated backtrace.

Ard Biesheuvel (2):
  ArmPlatformPkg: clear frame pointer in startup code
  ArmVirtPkg/PrePi: clear frame pointer in startup code

 ArmPlatformPkg/PrePeiCore/AArch64/PrePeiCoreEntryPoint.S | 3 +++
 ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S          | 3 +++
 ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S              | 3 +++
 3 files changed, 9 insertions(+)

-- 
2.17.1

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

Comments

Laszlo Ersek Nov. 19, 2018, 6:53 p.m. UTC | #1
On 11/16/18 23:55, Ard Biesheuvel wrote:
> The backtrace code on AARCH64 does not sanitize the frame pointer values

> it pulls of the stack when attempting to do a backtrace, and so junk left

> in the frame pointer register may result in a recursive exception and a

> truncated backtrace.

> 

> Ard Biesheuvel (2):

>   ArmPlatformPkg: clear frame pointer in startup code

>   ArmVirtPkg/PrePi: clear frame pointer in startup code

> 

>  ArmPlatformPkg/PrePeiCore/AArch64/PrePeiCoreEntryPoint.S | 3 +++

>  ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S          | 3 +++

>  ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S              | 3 +++

>  3 files changed, 9 insertions(+)

> 


Acked-by: Laszlo Ersek <lersek@redhat.com>


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Leif Lindholm Nov. 19, 2018, 6:56 p.m. UTC | #2
On Fri, Nov 16, 2018 at 02:55:56PM -0800, Ard Biesheuvel wrote:
> The backtrace code on AARCH64 does not sanitize the frame pointer values

> it pulls of the stack when attempting to do a backtrace, and so junk left

> in the frame pointer register may result in a recursive exception and a

> truncated backtrace.


If I was bikeshedding, I'd ask for a (NULL) in the comments next to
the 0x0. But other than that, for the series:
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

(be it green or black)

> Ard Biesheuvel (2):

>   ArmPlatformPkg: clear frame pointer in startup code

>   ArmVirtPkg/PrePi: clear frame pointer in startup code

> 

>  ArmPlatformPkg/PrePeiCore/AArch64/PrePeiCoreEntryPoint.S | 3 +++

>  ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S          | 3 +++

>  ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S              | 3 +++

>  3 files changed, 9 insertions(+)

> 

> -- 

> 2.17.1

> 

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Ard Biesheuvel Nov. 19, 2018, 7:28 p.m. UTC | #3
On Mon, 19 Nov 2018 at 10:56, Leif Lindholm <leif.lindholm@linaro.org> wrote:
>

> On Fri, Nov 16, 2018 at 02:55:56PM -0800, Ard Biesheuvel wrote:

> > The backtrace code on AARCH64 does not sanitize the frame pointer values

> > it pulls of the stack when attempting to do a backtrace, and so junk left

> > in the frame pointer register may result in a recursive exception and a

> > truncated backtrace.

>

> If I was bikeshedding, I'd ask for a (NULL) in the comments next to

> the 0x0. But other than that, for the series:

> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

> (be it green or black)

>


Thanks all.

Series pushed as 316b3a719fd2..81c6f1dfbac1 (after s/0x0/NULL/ in the comments)
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel