diff options
author | Jens Axboe <jaxboe@fusionio.com> | 2010-10-29 08:10:18 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-09 13:26:30 -0800 |
commit | 6e1fc7a18ebfa14bac5a1566651ee6474cbb9af4 (patch) | |
tree | 18e93049863554d1cd2fc42e2c083bda229de8e5 /block | |
parent | 239023a9d11fa1be4fec0adc4d9b840c4b815775 (diff) | |
download | linux-stable-6e1fc7a18ebfa14bac5a1566651ee6474cbb9af4.tar.gz linux-stable-6e1fc7a18ebfa14bac5a1566651ee6474cbb9af4.tar.bz2 linux-stable-6e1fc7a18ebfa14bac5a1566651ee6474cbb9af4.zip |
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.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/block/blk-map.c b/block/blk-map.c index 9083cf0180cc..30a7e5158930 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) |