diff options
author | Jens Axboe <jaxboe@fusionio.com> | 2010-10-29 08:10:18 -0600 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-11-10 14:40:42 +0100 |
commit | 9284bcf4e335e5f18a8bc7b26461c33ab60d0689 (patch) | |
tree | 82860d516748327e9be4903e541479e7ac40e6a1 /block | |
parent | 151f52f09c5728ecfdd0c289da1a4b30bb416f2c (diff) | |
download | linux-stable-9284bcf4e335e5f18a8bc7b26461c33ab60d0689.tar.gz linux-stable-9284bcf4e335e5f18a8bc7b26461c33ab60d0689.tar.bz2 linux-stable-9284bcf4e335e5f18a8bc7b26461c33ab60d0689.zip |
block: check for proper length of iov entries in blk_rq_map_user_iov()
Ensure that we pass down properly validated iov segments before
calling into the mapping or copy functions.
Reported-by: Dan Rosenberg <drosenberg@vsecurity.com>
Cc: stable@kernel.org
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-map.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/block/blk-map.c b/block/blk-map.c index d4a586d8691e..5d5dbe47c228 100644 --- a/block/blk-map.c +++ b/block/blk-map.c @@ -205,6 +205,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) || map_data) |