From: Mike Snitzer Date: Tue, 2 Aug 2011 11:32:00 +0000 (+0100) Subject: dm mpath: fix potential NULL pointer in feature arg processing X-Git-Tag: v2.6.32.44~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c72ff34c937a4572946fdcd79ecbff2fe81f7654;p=thirdparty%2Fkernel%2Fstable.git dm mpath: fix potential NULL pointer in feature arg processing commit 286f367dad40beb3234a18c17391d03ba939a7f3 upstream. Avoid dereferencing a NULL pointer if the number of feature arguments supplied is fewer than indicated. Signed-off-by: Mike Snitzer Signed-off-by: Alasdair G Kergon Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index fcf717cb2684e..b03cd39718302 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -778,6 +778,11 @@ static int parse_features(struct arg_set *as, struct multipath *m) if (!argc) return 0; + if (argc > as->argc) { + ti->error = "not enough arguments for features"; + return -EINVAL; + } + do { param_name = shift(as); argc--;