mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
block: check for proper length of iov entries in blk_rq_map_user_iov()
commit 9284bcf4e3 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
239023a9d1
commit
6e1fc7a18e
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user