Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765959AbZGABO6 (ORCPT ); Tue, 30 Jun 2009 21:14:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761572AbZGAAfu (ORCPT ); Tue, 30 Jun 2009 20:35:50 -0400 Received: from kroah.org ([198.145.64.141]:60690 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761585AbZGAAfk (ORCPT ); Tue, 30 Jun 2009 20:35:40 -0400 X-Mailbox-Line: From gregkh@mini.kroah.org Tue Jun 30 17:24:42 2009 Message-Id: <20090701002441.908488777@mini.kroah.org> User-Agent: quilt/0.48-1 Date: Tue, 30 Jun 2009 17:24:24 -0700 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, Mikulas Patocka , Alasdair G Kergon Subject: [patch 095/108] dm mpath: validate table argument count References: <20090701002249.937782934@mini.kroah.org> Content-Disposition: inline; filename=dm-mpath-validate-table-argument-count.patch In-Reply-To: <20090701002838.GA7100@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1406 Lines: 36 2.6.30-stable review patch. If anyone has any objections, please let us know. ------------------ From: Mikulas Patocka commit 0e0497c0c017664994819f4602dc07fd95896c52 upstream. The parser reads the argument count as a number but doesn't check that sufficient arguments are supplied. This command triggers the bug: dmsetup create mpath --table "0 `blockdev --getsize /dev/mapper/cr0` multipath 0 0 2 1 round-robin 1000 0 1 1 /dev/mapper/cr0 round-robin 0 1 1 /dev/mapper/cr1 1000" kernel BUG at drivers/md/dm-mpath.c:530! Signed-off-by: Mikulas Patocka Signed-off-by: Alasdair G Kergon Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-mpath.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -553,6 +553,12 @@ static int parse_path_selector(struct ar return -EINVAL; } + if (ps_argc > as->argc) { + dm_put_path_selector(pst); + ti->error = "not enough arguments for path selector"; + return -EINVAL; + } + r = pst->create(&pg->ps, ps_argc, as->argv); if (r) { dm_put_path_selector(pst); -- 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/