public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* heap/page guard broken on aarch64
@ 2023-07-12  8:41 Gerd Hoffmann
  2023-07-12 12:03 ` Ard Biesheuvel
  0 siblings, 1 reply; 4+ messages in thread
From: Gerd Hoffmann @ 2023-07-12  8:41 UTC (permalink / raw)
  To: devel, Ard Biesheuvel

  Hi,

Tried to debug a bug which looks like memory corruption, turned on page
and heap guard:

	PcdHeapGuardPageType=0x7e
	PcdHeapGuardPoolType=0x7e
	PcdHeapGuardPropertyMask=0x03

With that the firmware crashes due to a page fault.

Stack trace (with PCs manually mapped to functions):

PC 0x000047730268 (0x000047711000+0x0001F268) [ 0] DxeCore.dll  ->  InternalMemSetMem
PC 0x00004771F4EC (0x000047711000+0x0000E4EC) [ 0] DxeCore.dll  ->  CoreConvertPagesEx
PC 0x00004771FED4 (0x000047711000+0x0000EED4) [ 0] DxeCore.dll  ->  CoreFreePoolPagesI
PC 0x000047721368 (0x000047711000+0x00010368) [ 0] DxeCore.dll  ->  CoreFreePoolI
PC 0x000047721564 (0x000047711000+0x00010564) [ 0] DxeCore.dll  ->  CoreInternalFreePool
PC 0x00004772160C (0x000047711000+0x0001060C) [ 0] DxeCore.dll  ->  CoreFreePool
PC 0x00007C574338 (0x00007C560000+0x00014338) [ 1] VariableRuntimeDxe.dll  ->  FreePool
PC 0x00007C574F8C (0x00007C560000+0x00014F8C) [ 1] VariableRuntimeDxe.dll  ->  ReallocateRuntimePool
PC 0x00007C574FE0 (0x00007C560000+0x00014FE0) [ 1] VariableRuntimeDxe.dll  ->  VarCheckAddTableEntry
PC 0x00007C575FF0 (0x00007C560000+0x00015FF0) [ 1] VariableRuntimeDxe.dll  ->  VarCheckLibVariablePropertySet
PC 0x00007C5760B8 (0x00007C560000+0x000160B8) [ 1] VariableRuntimeDxe.dll  ->  VarCheckUefiLibNullClassConstructor
PC 0x00007C578828 (0x00007C560000+0x00018828) [ 1] VariableRuntimeDxe.dll  ->  _ModuleEntryPoint
PC 0x000047718788 (0x000047711000+0x00007788) [ 2] DxeCore.dll  ->  CoreStartImage
PC 0x000047725CC8 (0x000047711000+0x00014CC8) [ 2] DxeCore.dll  ->  CoreDispatcher
PC 0x00004771BFF0 (0x000047711000+0x0000AFF0) [ 2] DxeCore.dll  ->  _ModuleEntryPoint

Some debug logging added shows that the faulting address is right after
the memory block which gets freed, looks like the code tries to clear
the guard page ...

edk2-stable202305 is broken.
edk2-stable202302 works.
Trying to bisect did not work due to another bug.

take care,
  Gerd


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

end of thread, other threads:[~2023-07-12 21:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-12  8:41 heap/page guard broken on aarch64 Gerd Hoffmann
2023-07-12 12:03 ` Ard Biesheuvel
2023-07-12 13:26   ` Gerd Hoffmann
2023-07-12 21:20     ` [edk2-devel] " Oliver Smith-Denny

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