Re: [PATCH 7/7] mv user buffer copy access_ok test to block helper

Mike Christie
2007-03-04T22:56:55Z

michaelc@cs.wisc.edu wrote:
> + if (!access_ok(read ?
> + VERIFY_WRITE : VERIFY_READ,
> + p, iov_len))
> + return -EFAULT;
> }
>
> copy_bytes = min(iov_len, bvec->bv_len - bvec_offset);
> - if (bio_data_dir(head) == READ)
> + if (read)
> ret = copy_to_user(p, addr, copy_bytes);
> else
> ret = copy_from_user(addr, p, copy_bytes);

Tomo notified me that copy_from/to_user does the access_ok test so this
patch is not needed.