Check if L2 entry exists for the given VA before loading L3 entry.

This is a fix for a panic that was easy to reproduce executing
"(/bin/ls &)" in the shell.

Sponsored by:	DARPA, AFRL
This commit is contained in:
br 2016-11-14 18:30:03 +00:00
parent 94d6bfd59a
commit 647ceffee9

View File

@ -1992,6 +1992,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot)
l2 = pmap_l1_to_l2(l1, sva);
if (l2 == NULL)
continue;
if (pmap_load(l2) == 0)
continue;
if ((pmap_load(l2) & PTE_RX) != 0)
continue;