summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/CommonDataClass/Exceptions.py
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2020-03-25 17:54:09 +0300
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-03-26 13:34:14 +0300
commitd390920ed41ebdf78402288416a284cf8bcde620 (patch)
tree196ab24b1b085722e1dbcd71759c14ee0d316b1c /BaseTools/Source/Python/CommonDataClass/Exceptions.py
parentf52b30e73ddee9a3a609a6e5aa87e79cf4f50879 (diff)
downloadedk2-d390920ed41ebdf78402288416a284cf8bcde620.tar.xz
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>
Diffstat (limited to 'BaseTools/Source/Python/CommonDataClass/Exceptions.py')
0 files changed, 0 insertions, 0 deletions