diff options
author | Fares Mehanna <faresx@amazon.de> | 2024-09-02 16:33:08 +0000 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2024-09-04 16:30:23 +0100 |
commit | 7eced90b202d63cdc1b9b11b1353adb1389830f9 (patch) | |
tree | 7a4c1f262d2d388c946dcded0a96ad2460a3c963 /tools/perf/scripts/python/gecko.py | |
parent | 1db9716d44875d31acf29255710e82338560c177 (diff) |
arm64: trans_pgd: mark PTEs entries as valid to avoid dead kexec()
The reasons for PTEs in the kernel direct map to be marked invalid are not
limited to kfence / debug pagealloc machinery. In particular,
memfd_secret() also steals pages with set_direct_map_invalid_noflush().
When building the transitional page tables for kexec from the current
kernel's page tables, those pages need to become regular writable pages,
otherwise, if the relocation places kexec segments over such pages, a fault
will occur during kexec, leading to host going dark during kexec.
This patch addresses the kexec issue by marking any PTE as valid if it is
not none. While this fixes the kexec crash, it does not address the
security concern that if processes owning secret memory are not terminated
before kexec, the secret content will be mapped in the new kernel without
being scrubbed.
Suggested-by: Jan H. Schönherr <jschoenh@amazon.de>
Signed-off-by: Fares Mehanna <faresx@amazon.de>
Link: https://lore.kernel.org/r/20240902163309.97113-1-faresx@amazon.de
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/gecko.py')
0 files changed, 0 insertions, 0 deletions