fuse: fix killing s[ug]id in setattr
[pandora-kernel.git] / fs / read_write.c
index dfd1257..5ad4248 100644 (file)
@@ -633,7 +633,8 @@ ssize_t do_loop_readv_writev(struct file *filp, struct iovec *iov,
 ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
                              unsigned long nr_segs, unsigned long fast_segs,
                              struct iovec *fast_pointer,
-                             struct iovec **ret_pointer)
+                             struct iovec **ret_pointer,
+                             int check_access)
 {
        unsigned long seg;
        ssize_t ret;
@@ -689,7 +690,8 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
                        ret = -EINVAL;
                        goto out;
                }
-               if (unlikely(!access_ok(vrfy_dir(type), buf, len))) {
+               if (check_access
+                   && unlikely(!access_ok(vrfy_dir(type), buf, len))) {
                        ret = -EFAULT;
                        goto out;
                }
@@ -721,7 +723,7 @@ static ssize_t do_readv_writev(int type, struct file *file,
        }
 
        ret = rw_copy_check_uvector(type, uvector, nr_segs,
-                       ARRAY_SIZE(iovstack), iovstack, &iov);
+                                   ARRAY_SIZE(iovstack), iovstack, &iov, 1);
        if (ret <= 0)
                goto out;