summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2010-10-29 08:10:18 -0600
committerGreg Kroah-Hartman <gregkh@suse.de>2010-12-09 13:24:15 -0800
commit9a8fd43f43c06d372c6c3f3ae592683cc8603277 (patch)
tree4d4258365271a2584271c0f3be1fe6750520d303 /block
parent15816687e085c3e1acfb7b0f9446bd9999bb1a0b (diff)
block: check for proper length of iov entries in blk_rq_map_user_iov()
commit 9284bcf4e335e5f18a8bc7b26461c33ab60d0689 upstream. Ensure that we pass down properly validated iov segments before calling into the mapping or copy functions. Reported-by: Dan Rosenberg <drosenberg@vsecurity.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'block')
-rw-r--r--block/blk-map.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/blk-map.c b/block/blk-map.c
index af37e4ae62f5..bdf10b9e0a58 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -191,6 +191,8 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
unaligned = 1;
break;
}
+ if (!iov[i].iov_len)
+ return -EINVAL;
}
if (unaligned || (q->dma_pad_mask & len))