summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorLiu Shixin <liushixin2@huawei.com>2022-11-22 20:31:37 +0800
committerWill Deacon <will@kernel.org>2023-01-05 15:05:22 +0000
commit730a11f982e61aaef758ab552dfb7c30de79e99b (patch)
tree0cacabd3fff182cb7e07f99661ad8d4320352002 /arch
parent74c2f81054510d45b813548cb0a1c4ebf87cdd5f (diff)
arm64/mm: add pud_user_exec() check in pud_user_accessible_page()
Add check for the executable case in pud_user_accessible_page() too like what we did for pte and pmd. Fixes: 42b2547137f5 ("arm64/mm: enable ARCH_SUPPORTS_PAGE_TABLE_CHECK") Suggested-by: Will Deacon <will@kernel.org> Signed-off-by: Liu Shixin <liushixin2@huawei.com> Link: https://lore.kernel.org/r/20221122123137.429686-1-liushixin2@huawei.com Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/include/asm/pgtable.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index 67fc6fdb03fd..780973a6cbb6 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -681,7 +681,7 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd)
#define pud_leaf(pud) (pud_present(pud) && !pud_table(pud))
#define pud_valid(pud) pte_valid(pud_pte(pud))
#define pud_user(pud) pte_user(pud_pte(pud))
-
+#define pud_user_exec(pud) pte_user_exec(pud_pte(pud))
static inline void set_pud(pud_t *pudp, pud_t pud)
{
@@ -867,7 +867,7 @@ static inline bool pmd_user_accessible_page(pmd_t pmd)
static inline bool pud_user_accessible_page(pud_t pud)
{
- return pud_leaf(pud) && pud_user(pud);
+ return pud_leaf(pud) && (pud_user(pud) || pud_user_exec(pud));
}
#endif