Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361195
b: refs/heads/master
c: 8aec0f5
h: refs/heads/master
i:
  361193: 337a9fd
  361191: 20f19be
v: v3
  • Loading branch information
Mathieu Desnoyers authored and Linus Torvalds committed Mar 12, 2013
1 parent b1b9da5 commit 5991325
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c39ac49f23424086b43aceeace243f7a8bcc3ad8
refs/heads/master: 8aec0f5d4137532de14e6554fd5dd201ff3a3c49
15 changes: 7 additions & 8 deletions trunk/fs/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,10 @@ ssize_t compat_rw_copy_check_uvector(int type,
}
*ret_pointer = iov;

ret = -EFAULT;
if (!access_ok(VERIFY_READ, uvector, nr_segs*sizeof(*uvector)))
goto out;

/*
* Single unix specification:
* We should -EINVAL if an element length is not >= 0 and fitting an
Expand Down Expand Up @@ -1080,17 +1084,12 @@ static ssize_t compat_do_readv_writev(int type, struct file *file,
if (!file->f_op)
goto out;

ret = -EFAULT;
if (!access_ok(VERIFY_READ, uvector, nr_segs*sizeof(*uvector)))
goto out;

tot_len = compat_rw_copy_check_uvector(type, uvector, nr_segs,
ret = compat_rw_copy_check_uvector(type, uvector, nr_segs,
UIO_FASTIOV, iovstack, &iov);
if (tot_len == 0) {
ret = 0;
if (ret <= 0)
goto out;
}

tot_len = ret;
ret = rw_verify_area(type, file, pos, tot_len);
if (ret < 0)
goto out;
Expand Down
8 changes: 0 additions & 8 deletions trunk/mm/process_vm_access.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,6 @@ compat_process_vm_rw(compat_pid_t pid,
if (flags != 0)
return -EINVAL;

if (!access_ok(VERIFY_READ, lvec, liovcnt * sizeof(*lvec)))
goto out;

if (!access_ok(VERIFY_READ, rvec, riovcnt * sizeof(*rvec)))
goto out;

if (vm_write)
rc = compat_rw_copy_check_uvector(WRITE, lvec, liovcnt,
UIO_FASTIOV, iovstack_l,
Expand All @@ -459,8 +453,6 @@ compat_process_vm_rw(compat_pid_t pid,
kfree(iov_r);
if (iov_l != iovstack_l)
kfree(iov_l);

out:
return rc;
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/security/keys/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ static long compat_keyctl_instantiate_key_iov(
ARRAY_SIZE(iovstack),
iovstack, &iov);
if (ret < 0)
return ret;
goto err;
if (ret == 0)
goto no_payload_free;

ret = keyctl_instantiate_key_common(id, iov, ioc, ret, ringid);

err:
if (iov != iovstack)
kfree(iov);
return ret;
Expand Down

0 comments on commit 5991325

Please sign in to comment.