Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754745Ab0LHAeQ (ORCPT ); Tue, 7 Dec 2010 19:34:16 -0500 Received: from kroah.org ([198.145.64.141]:54680 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754013Ab0LHAeP (ORCPT ); Tue, 7 Dec 2010 19:34:15 -0500 X-Mailbox-Line: From gregkh@clark.site Tue Dec 7 16:06:39 2010 Message-Id: <20101208000639.621495889@clark.site> User-Agent: quilt/0.48-11.2 Date: Tue, 07 Dec 2010 16:04:00 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Jens Axboe Subject: [01/44] block: check for proper length of iov entries in blk_rq_map_user_iov() In-Reply-To: <20101208003205.GA4286@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1008 Lines: 37 2.6.27-stable review patch. If anyone has any objections, please let us know. ------------------ From: Jens Axboe commit 9284bcf4e335e5f18a8bc7b26461c33ab60d0689 upstream. Ensure that we pass down properly validated iov segments before calling into the mapping or copy functions. Reported-by: Dan Rosenberg Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- block/blk-map.c | 2 ++ 1 file changed, 2 insertions(+) --- a/block/blk-map.c +++ b/block/blk-map.c @@ -191,6 +191,8 @@ int blk_rq_map_user_iov(struct request_q unaligned = 1; break; } + if (!iov[i].iov_len) + return -EINVAL; } if (unaligned || (q->dma_pad_mask & len)) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/