mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 8/11] rsxx: Adapter address space sanity check.
@ 2013-06-18 19:48 Philip J. Kelleher
  0 siblings, 0 replies; only message in thread
From: Philip J. Kelleher @ 2013-06-18 19:48 UTC (permalink / raw)
  To: axboe; +Cc: linux-kernel, brking

From: Philip J Kelleher <pjk1939@linux.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@linux.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;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-06-18 19:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-18 19:48 [PATCH 8/11] rsxx: Adapter address space sanity check Philip J. Kelleher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®