arm64/mm: Intercept pfn changes in set_pte_at()
authorAnshuman Khandual <anshuman.khandual@arm.com>
Mon, 30 Jan 2023 12:14:57 +0000 (17:44 +0530)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 31 Jan 2023 15:58:09 +0000 (15:58 +0000)
commit004fc58f917cfea5d7190139e3ed1b7a13e39c25
tree5e2b56b0a2ec30dc5e57b4cb6c2b4897d89180b7
parenta70f00e7f1a3132a2ff6f0516fe990e710ae8c1c
arm64/mm: Intercept pfn changes in set_pte_at()

Changing pfn on a user page table mapped entry, without first going through
break-before-make (BBM) procedure is unsafe. This just updates set_pte_at()
to intercept such changes, via an updated pgattr_change_is_safe(). This new
check happens via __check_racy_pte_update(), which has now been renamed as
__check_safe_pte_update().

Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Link: https://lore.kernel.org/r/20230130121457.1607675-1-anshuman.khandual@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/pgtable.h
arch/arm64/mm/mmu.c