diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-06 16:18:14 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-12-10 19:07:26 +0100 |
commit | d41fb2fbb28d3a1085960edada6c046becd1fafd (patch) | |
tree | da8364a6cc8f924a8edcd34605c209d2e5a7bd74 | |
parent | fd1aa12c63400ca7d5b6d189ae98570f47735180 (diff) |
Don't feed anything but regular iovec's to blk_rq_map_user_iov
commit a0ac402cfcdc904f9772e1762b3fda112dcc56a0 upstream.
In theory we could map other things, but there's a reason that function
is called "user_iov". Using anything else (like splice can do) just
confuses it.
Reported-and-tested-by: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | block/blk-map.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/block/blk-map.c b/block/blk-map.c index f565e11f465a..69953bd97e65 100644 --- a/block/blk-map.c +++ b/block/blk-map.c @@ -90,6 +90,9 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, if (!iter || !iter->count) return -EINVAL; + if (!iter_is_iovec(iter)) + return -EINVAL; + iov_for_each(iov, i, *iter) { unsigned long uaddr = (unsigned long) iov.iov_base; |