]> Pileus Git - ~andy/linux/blobdiff - fs/read_write.c
Merge tag 'sunxi-fixes-for-3.14' of https://github.com/mripard/linux into fixes
[~andy/linux] / fs / read_write.c
index 58e440df1bc687e3dd3eea50fe38f018a6cc192b..edc5746a902a090ce4dbda6b8b1205e729dff5b3 100644 (file)
@@ -901,10 +901,6 @@ static ssize_t compat_do_readv_writev(int type, struct file *file,
        io_fn_t fn;
        iov_fn_t fnv;
 
-       ret = -EFAULT;
-       if (!access_ok(VERIFY_READ, uvector, nr_segs*sizeof(*uvector)))
-               goto out;
-
        ret = compat_rw_copy_check_uvector(type, uvector, nr_segs,
                                               UIO_FASTIOV, iovstack, &iov);
        if (ret <= 0)
@@ -968,9 +964,9 @@ out:
        return ret;
 }
 
-COMPAT_SYSCALL_DEFINE3(readv, unsigned long, fd,
+COMPAT_SYSCALL_DEFINE3(readv, compat_ulong_t, fd,
                const struct compat_iovec __user *,vec,
-               unsigned long, vlen)
+               compat_ulong_t, vlen)
 {
        struct fd f = fdget(fd);
        ssize_t ret;
@@ -1005,9 +1001,9 @@ COMPAT_SYSCALL_DEFINE4(preadv64, unsigned long, fd,
        return ret;
 }
 
-COMPAT_SYSCALL_DEFINE5(preadv, unsigned long, fd,
+COMPAT_SYSCALL_DEFINE5(preadv, compat_ulong_t, fd,
                const struct compat_iovec __user *,vec,
-               unsigned long, vlen, u32, pos_low, u32, pos_high)
+               compat_ulong_t, vlen, u32, pos_low, u32, pos_high)
 {
        loff_t pos = ((loff_t)pos_high << 32) | pos_low;
        return compat_sys_preadv64(fd, vec, vlen, pos);
@@ -1035,9 +1031,9 @@ out:
        return ret;
 }
 
-COMPAT_SYSCALL_DEFINE3(writev, unsigned long, fd,
+COMPAT_SYSCALL_DEFINE3(writev, compat_ulong_t, fd,
                const struct compat_iovec __user *, vec,
-               unsigned long, vlen)
+               compat_ulong_t, vlen)
 {
        struct fd f = fdget(fd);
        ssize_t ret;
@@ -1072,9 +1068,9 @@ COMPAT_SYSCALL_DEFINE4(pwritev64, unsigned long, fd,
        return ret;
 }
 
-COMPAT_SYSCALL_DEFINE5(pwritev, unsigned long, fd,
+COMPAT_SYSCALL_DEFINE5(pwritev, compat_ulong_t, fd,
                const struct compat_iovec __user *,vec,
-               unsigned long, vlen, u32, pos_low, u32, pos_high)
+               compat_ulong_t, vlen, u32, pos_low, u32, pos_high)
 {
        loff_t pos = ((loff_t)pos_high << 32) | pos_low;
        return compat_sys_pwritev64(fd, vec, vlen, pos);