[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1321210507.18929.293.camel@deadeye>
Date: Sun, 13 Nov 2011 18:55:07 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: Jens Axboe <axboe@...nel.dk>
Cc: Xiaotian Feng <dfeng@...hat.com>,
Dan Rosenberg <drosenberg@...curity.com>,
Dan Carpenter <dan.carpenter@...cle.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] block: Always check length of all iov entries in
blk_rq_map_user_iov()
Even after commit 5478755616ae2ef1ce144dded589b62b2a50d575
("block: check for proper length of iov entries earlier ...")
we still won't check for zero-length entries after an unaligned
entry. Remove the break-statement, so all entries are checked.
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
Cc: stable@...r.kernel.org
---
block/blk-map.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/block/blk-map.c b/block/blk-map.c
index e663ac2..2e852a4 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -204,10 +204,8 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
if (!iov[i].iov_len)
return -EINVAL;
- if (uaddr & queue_dma_alignment(q)) {
+ if (uaddr & queue_dma_alignment(q))
unaligned = 1;
- break;
- }
}
if (unaligned || (q->dma_pad_mask & len) || map_data)
--
1.7.7.2
--
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