audk/ArmPkg/Library
Ard Biesheuvel d390920ed4 ArmPkg/ArmMmuLib AARCH64: limit recursion when freeing page tables
FreePageTablesRecursive () traverses the page table tree depth first
to free all pages that it finds, without taking into account the
level at which it is operating.

Since TT_TYPE_TABLE_ENTRY aliases TT_TYPE_BLOCK_ENTRY_LEVEL3, we cannot
distinguish table entries from block entries unless we take the level
into account, and so we may be dereferencing garbage if we happen to
try and free a hierarchy of page tables that has level 3 pages in it.

Let's fix this by passing the level into FreePageTablesRecursive (),
and limit the recursion to levels < 3.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
Reviewed-by: Ashish Singhal <ashishsingha@nvidia.com>
Tested-by: Ashish Singhal <ashishsingha@nvidia.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
2020-03-26 10:34:14 +00:00
..
ArmArchTimerLib ArmPkg: Fix various typos 2019-07-04 12:20:28 +01:00
ArmCacheMaintenanceLib ArmPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
ArmDisassemblerLib ArmPkg: Fix various typos 2019-07-04 12:20:28 +01:00
ArmExceptionLib ArmPkg: Fix various typos 2019-07-04 12:20:28 +01:00
ArmGenericTimerPhyCounterLib ArmPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
ArmGenericTimerVirtCounterLib ArmPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
ArmGicArchLib ArmPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
ArmGicArchSecLib ArmPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
ArmHvcLib ArmPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
ArmLib ArmPkg/ArmLib: Fix cache-invalidate initial page tables 2020-03-19 17:35:32 +00:00
ArmMmuLib ArmPkg/ArmMmuLib AARCH64: limit recursion when freeing page tables 2020-03-26 10:34:14 +00:00
ArmMtlNullLib ArmPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
ArmPsciResetSystemLib ArmPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
ArmSmcLib ArmPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
ArmSmcLibNull ArmPkg: convert LFs to CRLF, expand hard TABs 2020-03-04 12:22:07 +00:00
ArmSmcPsciResetSystemLib ArmPkg/ArmSmcPsciResetSystemLib: remove EnterS3WithImmediateWake () 2020-01-14 22:12:17 +00:00
ArmSoftFloatLib ArmPkg: convert LFs to CRLF, expand hard TABs 2020-03-04 12:22:07 +00:00
ArmSvcLib ArmPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
CompilerIntrinsicsLib ArmPkg: convert LFs to CRLF, expand hard TABs 2020-03-04 12:22:07 +00:00
DebugAgentSymbolsBaseLib ArmPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
DebugPeCoffExtraActionLib ArmPkg: DebugPeCoffExtraActionLib: fix trivial comment typos 2019-07-30 14:58:17 +01:00
DefaultExceptionHandlerLib ArmPkg: Fix various typos 2019-07-04 12:20:28 +01:00
GccLto ArmPkg: convert LFs to CRLF, expand hard TABs 2020-03-04 12:22:07 +00:00
OpteeLib ArmPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
PeiServicesTablePointerLib ArmPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
PlatformBootManagerLib ArmPkg: Dispatch deferred images after EndOfDxe 2019-12-05 20:28:44 +00:00
RvdPeCoffExtraActionLib ArmPkg: Fix various typos 2019-07-04 12:20:28 +01:00
SemiHostingDebugLib ArmPkg: Fix various typos 2019-07-04 12:20:28 +01:00
SemiHostingSerialPortLib ArmPkg: Fix various typos 2019-07-04 12:20:28 +01:00
SemihostLib ArmPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
StandaloneMmMmuLib ArmPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00