Skip to content

Commit

Permalink
rsxx: Adapter address space sanity check.
Browse files Browse the repository at this point in the history
Adding a sanity check to guarentee that DMAs outside of the device's
address space will be errored out right away.

Signed-off-by: Philip J Kelleher <pjk1939@linux.vnet.ibm.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Philip J Kelleher authored and Jens Axboe committed Jun 19, 2013
1 parent 66bc600 commit 3eb8dca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/block/rsxx/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ static void rsxx_make_request(struct request_queue *q, struct bio *bio)
if (!card)
goto req_err;

if (bio->bi_sector + (bio->bi_size >> 9) > get_capacity(card->gendisk))
goto req_err;

if (unlikely(card->halt)) {
st = -EFAULT;
goto req_err;
Expand Down

0 comments on commit 3eb8dca

Please sign in to comment.