Skip to content

Commit 9284bcf

Browse files
author
Jens Axboe
committed
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>
1 parent 151f52f commit 9284bcf

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎block/blk-map.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
205205
unaligned = 1;
206206
break;
207207
}
208+
if (!iov[i].iov_len)
209+
return -EINVAL;
208210
}
209211

210212
if (unaligned || (q->dma_pad_mask & len) || map_data)

0 commit comments

Comments
 (0)