Skip to content

Commit

Permalink
block: check for proper length of iov entries in blk_rq_map_user_iov()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Axboe committed Nov 10, 2010
1 parent 151f52f commit 9284bcf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions block/blk-map.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9284bcf

Please sign in to comment.