Return EFAULT when the address is not a kernel virtual address.

This commit is contained in:
Marcel Moolenaar 2013-02-16 21:46:27 +00:00
parent 7a4accc1f0
commit cb35030ab3

View File

@ -128,6 +128,8 @@ kmemphys:
*/ */
addr = trunc_page(v); addr = trunc_page(v);
eaddr = round_page(v + c); eaddr = round_page(v + c);
if (addr < VM_MAXUSER_ADDRESS)
return (EFAULT);
for (; addr < eaddr; addr += PAGE_SIZE) { for (; addr < eaddr; addr += PAGE_SIZE) {
if (pmap_kextract(addr) == 0) if (pmap_kextract(addr) == 0)
return (EFAULT); return (EFAULT);