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 <[email protected]>
Cc: [email protected]
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
Jens Axboe committed 2010-11-10 14:40:42 +01:00
1 parent 151f52f09c
commit 9284bcf4e3
1 file changed
+2
+2
View File
@@ -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)