mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
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>
This commit is contained in:
@@ -205,6 +205,8 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
|
|||||||
unaligned = 1;
|
unaligned = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (!iov[i].iov_len)
|
||||||
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unaligned || (q->dma_pad_mask & len) || map_data)
|
if (unaligned || (q->dma_pad_mask & len) || map_data)
|
||||||
|
Reference in New Issue
Block a user