# HG changeset patch # User tobaru # Date 1579855465 -32400 # Node ID 098942ff5f44f490cf956f77151b19e92dbd5bc4 # Parent c1d1721fd90745e5f03cd9c44580ca0c83952900 uva2ka_check_pte_ap diff -r c1d1721fd907 -r 098942ff5f44 src/impl/vm_impl_private.cbc --- a/src/impl/vm_impl_private.cbc Fri Jan 24 17:41:35 2020 +0900 +++ b/src/impl/vm_impl_private.cbc Fri Jan 24 17:44:25 2020 +0900 @@ -302,6 +302,12 @@ } __code uva2ka_check_pte_ap(struct vm_impl* vm, pde_t* pgdir, char* uva, pte_t* pte, __code next(int ret, ...)) { + // make sure it is a user page + if (PTE_AP(*pte) != AP_KU) { + ret = 0; + goto next(ret, ...); + } + ret = (char*) p2v(PTE_ADDR(*pte)); goto next(ret, ...); }