aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe2010-10-29 09:10:18 -0500
committerJens Axboe2010-11-10 07:40:42 -0600
commit9284bcf4e335e5f18a8bc7b26461c33ab60d0689 (patch)
tree82860d516748327e9be4903e541479e7ac40e6a1 /block/blk-map.c
parent151f52f09c5728ecfdd0c289da1a4b30bb416f2c (diff)
downloadkernel-common-9284bcf4e335e5f18a8bc7b26461c33ab60d0689.tar.gz
kernel-common-9284bcf4e335e5f18a8bc7b26461c33ab60d0689.tar.xz
kernel-common-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/blk-map.c')
-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 d4a586d8691..5d5dbe47c22 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,
205 unaligned = 1; 205 unaligned = 1;
206 break; 206 break;
207 } 207 }
208 if (!iov[i].iov_len)
209 return -EINVAL;
208 } 210 }
209 211
210 if (unaligned || (q->dma_pad_mask & len) || map_data) 212 if (unaligned || (q->dma_pad_mask & len) || map_data)