mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
MFi386 r1.369
- Clear the PG_WRITEABLE flag in pmap_page_protect() if write access is being removed. Return immediately if write access is being removed and PG_WRITEABLE is already clear.
This commit is contained in:
parent
e66b2829eb
commit
779df20df2
1 changed files with 3 additions and 0 deletions
|
|
@ -2213,6 +2213,8 @@ pmap_page_protect(vm_page_t m, vm_prot_t prot)
|
|||
if ((prot & VM_PROT_WRITE) != 0)
|
||||
return;
|
||||
if (prot & (VM_PROT_READ | VM_PROT_EXECUTE)) {
|
||||
if ((m->flags & PG_WRITEABLE) == 0)
|
||||
return;
|
||||
TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
|
||||
int newprot = pte_prot(pv->pv_pmap, prot);
|
||||
pmap_t oldpmap = pmap_install(pv->pv_pmap);
|
||||
|
|
@ -2223,6 +2225,7 @@ pmap_page_protect(vm_page_t m, vm_prot_t prot)
|
|||
pmap_invalidate_page(pv->pv_pmap, pv->pv_va);
|
||||
pmap_install(oldpmap);
|
||||
}
|
||||
vm_page_flag_clear(m, PG_WRITEABLE);
|
||||
} else {
|
||||
pmap_remove_all(m);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue