Skip to content

Commit a0ac402

Browse files
committed
Don't feed anything but regular iovec's to blk_rq_map_user_iov
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 <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent bc3913a commit a0ac402

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

block/blk-map.c

+4
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
118118
struct iov_iter i;
119119
int ret;
120120

121+
if (!iter_is_iovec(iter))
122+
goto fail;
123+
121124
if (map_data)
122125
copy = true;
123126
else if (iov_iter_alignment(iter) & align)
@@ -140,6 +143,7 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
140143

141144
unmap_rq:
142145
__blk_rq_unmap_user(bio);
146+
fail:
143147
rq->bio = NULL;
144148
return -EINVAL;
145149
}

0 commit comments

Comments
 (0)