diff
< 	kern_buf = memdup_user(buf, nbytes);
---
> 	if (!access_ok(buf, nbytes))
> 		return -EFAULT;
> 	kern_buf = memdup_user(buf, nbytes);
