Commit 98232d50 authored by Jens Axboe's avatar Jens Axboe

[PATCH] compat_sys_vmsplice: one-off in UIO_MAXIOV check

nr_segs may not be > UIO_MAXIOV, however it may be equal to. This makes
the behaviour identical to the real sys_vmsplice(). The other foov
syscalls also agree that this is the way to go.
Signed-off-by: default avatarJens Axboe <axboe@suse.de>
parent a0548871
...@@ -1323,7 +1323,7 @@ compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32, ...@@ -1323,7 +1323,7 @@ compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32,
{ {
unsigned i; unsigned i;
struct iovec *iov; struct iovec *iov;
if (nr_segs >= UIO_MAXIOV) if (nr_segs > UIO_MAXIOV)
return -EINVAL; return -EINVAL;
iov = compat_alloc_user_space(nr_segs * sizeof(struct iovec)); iov = compat_alloc_user_space(nr_segs * sizeof(struct iovec));
for (i = 0; i < nr_segs; i++) { for (i = 0; i < nr_segs; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment