Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Liu Shixin and committed by
Will Deacon
730a11f9 74c2f810

+2 -2
+2 -2
arch/arm64/include/asm/pgtable.h
··· 681 681 #define pud_leaf(pud) (pud_present(pud) && !pud_table(pud)) 682 682 #define pud_valid(pud) pte_valid(pud_pte(pud)) 683 683 #define pud_user(pud) pte_user(pud_pte(pud)) 684 - 684 + #define pud_user_exec(pud) pte_user_exec(pud_pte(pud)) 685 685 686 686 static inline void set_pud(pud_t *pudp, pud_t pud) 687 687 { ··· 867 867 868 868 static inline bool pud_user_accessible_page(pud_t pud) 869 869 { 870 - return pud_leaf(pud) && pud_user(pud); 870 + return pud_leaf(pud) && (pud_user(pud) || pud_user_exec(pud)); 871 871 } 872 872 #endif 873 873