Skip to content

Commit 0816b2e

Browse files
committed
LoongArch: Add pgprot_nx() implementation
Commit cca98e9 ("mm: enforce that vmap can't map pages executable") enforces the W^X protection by not allowing remapping existing pages as executable. Add LoongArch bits so that LoongArch can benefit the same protection. Signed-off-by: Huacai Chen <[email protected]>
1 parent 613d416 commit 0816b2e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

arch/loongarch/include/asm/pgtable-bits.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@
9696

9797
#define _PAGE_IOREMAP pgprot_val(PAGE_KERNEL_SUC)
9898

99+
#define pgprot_nx pgprot_nx
100+
101+
static inline pgprot_t pgprot_nx(pgprot_t _prot)
102+
{
103+
return __pgprot(pgprot_val(_prot) | _PAGE_NO_EXEC);
104+
}
105+
99106
#define pgprot_noncached pgprot_noncached
100107

101108
static inline pgprot_t pgprot_noncached(pgprot_t _prot)

0 commit comments

Comments
 (0)