arm64: mm: fix p?d_leaf()
authorMuchun Song <songmuchun@bytedance.com>
Fri, 22 Apr 2022 06:00:33 +0000 (14:00 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Apr 2022 12:38:55 +0000 (14:38 +0200)
commitd3acd3f9f80e642519704b4d905e1ee622fea495
tree502c77cf74e06bf98e996b7d76cfc1eaf5403349
parentec9cb700cbf7a4d670bc4444cb1ad5bfb6064fc7
arm64: mm: fix p?d_leaf()

[ Upstream commit 23bc8f69f0eceecbb87c3801d2e48827d2dca92b ]

The pmd_leaf() is used to test a leaf mapped PMD, however, it misses
the PROT_NONE mapped PMD on arm64.  Fix it.  A real world issue [1]
caused by this was reported by Qian Cai. Also fix pud_leaf().

Link: https://patchwork.kernel.org/comment/24798260/
Fixes: 8aa82df3c123 ("arm64: mm: add p?d_leaf() definitions")
Reported-by: Qian Cai <quic_qiancai@quicinc.com>
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Link: https://lore.kernel.org/r/20220422060033.48711-1-songmuchun@bytedance.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm64/include/asm/pgtable.h