From cb35030ab3bf63589280eb34810cb1acc5d1a44c Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Sat, 16 Feb 2013 21:46:27 +0000 Subject: [PATCH] Return EFAULT when the address is not a kernel virtual address. --- sys/ia64/ia64/mem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/ia64/ia64/mem.c b/sys/ia64/ia64/mem.c index 339985d662dd..70dcf7bfcc6f 100644 --- a/sys/ia64/ia64/mem.c +++ b/sys/ia64/ia64/mem.c @@ -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);