Return EFAULT when the address is not a kernel virtual address.
This commit is contained in:
parent
7a4accc1f0
commit
cb35030ab3
@ -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