From: Linus Torvalds Date: Wed, 7 Dec 2016 00:18:14 +0000 (-0800) Subject: Don't feed anything but regular iovec's to blk_rq_map_user_iov X-Git-Tag: firefly_0821_release~176^2~4^2~9^2~5 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d41fb2fbb28d3a1085960edada6c046becd1fafd;p=firefly-linux-kernel-4.4.55.git 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 Cc: Al Viro Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- 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;