Return EFAULT when the address is not a kernel virtual address.
This commit is contained in:
parent
810f5b61cd
commit
e81aa2332a
@ -128,6 +128,8 @@ memrw(struct cdev *dev, struct uio *uio, int flags)
|
||||
*/
|
||||
addr = trunc_page(v);
|
||||
eaddr = round_page(v + c);
|
||||
if (addr < VM_MAXUSER_ADDRESS)
|
||||
return (EFAULT);
|
||||
for (; addr < eaddr; addr += PAGE_SIZE) {
|
||||
if (pmap_kextract(addr) == 0)
|
||||
return (EFAULT);
|
||||
|
Loading…
Reference in New Issue
Block a user