linux-stable/arch/arm64/mm
Nikhil V a8bd38dbc5 arm64: mm: Make hibernation aware of KFENCE
In the restore path, swsusp_arch_suspend_exit uses copy_page() to
over-write memory. However, with features like KFENCE enabled, there could
be situations where it may have marked some pages as not valid, due to
which it could be reported as invalid accesses.

Consider a situation where page 'P' was part of the hibernation image.
Now, when the resume kernel tries to restore the pages, the same page 'P'
is already in use in the resume kernel and is kfence protected, due to
which its mapping is removed from linear map. Since restoring pages happens
with the resume kernel page tables, we would end up accessing 'P' during
copy and results in kernel pagefault.

The proposed fix tries to solve this issue by marking PTE as valid for such
kfence protected pages.

Co-developed-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
Signed-off-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
Signed-off-by: Nikhil V <quic_nprakash@quicinc.com>
Link: https://lore.kernel.org/r/20230713070757.4093-1-quic_nprakash@quicinc.com
Signed-off-by: Will Deacon <will@kernel.org>
2023-07-20 11:44:50 +01:00
..
cache.S efi: arm64: enter with MMU and caches enabled 2023-01-24 11:51:08 +00:00
context.c arm64/mm: remove now-superfluous ISBs from TTBR writes 2023-06-15 17:47:54 +01:00
copypage.c arm64: Also reset KASAN tag if page is not PG_mte_tagged 2023-05-16 14:58:54 +01:00
dma-mapping.c Revert "Revert "arm64: dma: Drop cache invalidation from arch_dma_prep_coherent()"" 2023-03-30 16:23:03 +01:00
extable.c arm64: extable: cleanup redundant extable type EX_TYPE_FIXUP 2022-06-28 12:11:47 +01:00
fault.c arch/arm64/mm/fault: Fix undeclared variable error in do_page_fault() 2023-07-03 19:04:32 -07:00
fixmap.c arm64: mm: always map fixmap at page granularity 2023-04-11 18:55:28 +01:00
flush.c arm64: flush: include linux/libnvdimm.h 2023-05-25 17:44:02 +01:00
hugetlbpage.c arm64/hugetlb: pte_alloc_huge() pte_offset_huge() 2023-06-19 16:19:06 -07:00
init.c - Yosry Ahmed brought back some cgroup v1 stats in OOM logs. 2023-06-28 10:28:11 -07:00
ioremap.c arm64: mm: Convert to GENERIC_IOREMAP 2022-06-27 12:22:31 +01:00
kasan_init.c arm64: kasan: remove !KASAN_VMALLOC remnants 2023-06-06 17:39:05 +01:00
Makefile arm64: mm: move fixmap code to its own file 2023-04-11 18:55:28 +01:00
mmap.c arm64/mm: move protection_map[] inside the platform 2022-07-17 17:14:37 -07:00
mmu.c arm64: mm: fix VA-range sanity check 2023-06-15 17:51:07 +01:00
mteswap.c arm64: mte: Lock a page for MTE tag initialisation 2022-11-29 09:26:07 +00:00
pageattr.c mm,kfence: decouple kfence from page granularity mapping judgement 2023-03-27 16:15:20 +01:00
pgd.c mm: consolidate pgtable_cache_init() and pgd_cache_init() 2019-09-24 15:54:09 -07:00
physaddr.c arm64: Do not pass tagged addresses to __is_lm_address() 2021-02-02 17:44:47 +00:00
proc.S arm64: enable Permission Indirection Extension (PIE) 2023-06-06 16:52:41 +01:00
ptdump.c arm64: add FIXADDR_TOT_{START,SIZE} 2023-04-11 18:55:28 +01:00
ptdump_debugfs.c arm64: Add __init section marker to some functions 2021-04-08 17:45:10 +01:00
trans_pgd-asm.S arm64: kexec: configure EL2 vectors for kexec 2021-10-01 13:31:00 +01:00
trans_pgd.c arm64: mm: Make hibernation aware of KFENCE 2023-07-20 11:44:50 +01:00