[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20130618194837.GI6492@oc6784271780.ibm.com>
Date: Tue, 18 Jun 2013 14:48:38 -0500
From: "Philip J. Kelleher" <pjk1939@...ux.vnet.ibm.com>
To: axboe@...nel.dk
Cc: linux-kernel@...r.kernel.org, brking@...ux.vnet.ibm.com
Subject: [PATCH 8/11] rsxx: Adapter address space sanity check.
From: Philip J Kelleher <pjk1939@...ux.vnet.ibm.com>
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@...ux.vnet.ibm.com>
-------------------------------------------------------------------------------
diff -uprN -X linux-block-vanilla/Documentation/dontdiff linux-block-vanilla/drivers/block/rsxx/dev.c linux-block/drivers/block/rsxx/dev.c
--- linux-block-vanilla/drivers/block/rsxx/dev.c 2013-06-18 09:39:43.154903231 -0500
+++ linux-block/drivers/block/rsxx/dev.c 2013-06-18 09:44:02.210841168 -0500
@@ -174,6 +174,9 @@ static void rsxx_make_request(struct req
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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists