Skip to content

Commit 0ca1a07

Browse files
pussuwxiaoxiang781216
authored andcommitted
arm64_addrenv_pgmap.c: Revoke user execution access to kernel mmap'd pages
Otherwise, user can run code from there
1 parent eebff25 commit 0ca1a07

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/arm64/src/common/arm64_addrenv_pgmap.c

+4
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,10 @@ int up_addrenv_kmap_pages(void **pages, unsigned int npages, uintptr_t vaddr,
271271

272272
mask &= ~PTE_BLOCK_DESC_NG;
273273

274+
/* Also, revoke user execute access */
275+
276+
mask |= PTE_BLOCK_DESC_UXN;
277+
274278
/* Let arm64_map_pages do the work */
275279

276280
return arm64_map_pages(addrenv, (uintptr_t *)pages, npages, vaddr, mask);

0 commit comments

Comments
 (0)