Skip to content

Commit d41fb2f

Browse files
torvaldsgregkh
authored andcommitted
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>
1 parent fd1aa12 commit d41fb2f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

block/blk-map.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
9090
if (!iter || !iter->count)
9191
return -EINVAL;
9292

93+
if (!iter_is_iovec(iter))
94+
return -EINVAL;
95+
9396
iov_for_each(iov, i, *iter) {
9497
unsigned long uaddr = (unsigned long) iov.iov_base;
9598

0 commit comments

Comments
 (0)