summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2011-11-13 19:58:09 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-21 14:31:26 -0800
commitacc1887e7e0da5d19fb77b2a5e5c5db2d57667f9 (patch)
tree96c3f8a3160f80e9fab3903266fc19350b5fed90 /block
parent1f36bbbe41ab7043a428175a71b3948574938752 (diff)
downloadlinux-stable-acc1887e7e0da5d19fb77b2a5e5c5db2d57667f9.tar.gz
linux-stable-acc1887e7e0da5d19fb77b2a5e5c5db2d57667f9.tar.bz2
linux-stable-acc1887e7e0da5d19fb77b2a5e5c5db2d57667f9.zip
block: Always check length of all iov entries in blk_rq_map_user_iov()
commit 6b76106d8ef31111d6fc469564b83b5f5542794f upstream. Even after commit 5478755616ae2ef1ce144dded589b62b2a50d575 ("block: check for proper length of iov entries earlier ...") we still won't check for zero-length entries after an unaligned entry. Remove the break-statement, so all entries are checked. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'block')
-rw-r--r--block/blk-map.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block/blk-map.c b/block/blk-map.c
index e663ac2d8e68..164cd0059706 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -204,10 +204,11 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
if (!iov[i].iov_len)
return -EINVAL;
- if (uaddr & queue_dma_alignment(q)) {
+ /*
+ * Keep going so we check length of all segments
+ */
+ if (uaddr & queue_dma_alignment(q))
unaligned = 1;
- break;
- }
}
if (unaligned || (q->dma_pad_mask & len) || map_data)