summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2009-06-22 10:12:10 +0100
committerAlasdair G Kergon <agk@redhat.com>2009-06-22 10:12:10 +0100
commite094f4f15f5169526c7200b9bde44b900548a81e (patch)
tree5ca573d45371779a183276066578bed1f38f11c6
parent0e0497c0c017664994819f4602dc07fd95896c52 (diff)
downloadop-kernel-dev-e094f4f15f5169526c7200b9bde44b900548a81e.zip
op-kernel-dev-e094f4f15f5169526c7200b9bde44b900548a81e.tar.gz
dm mpath: validate hw_handler argument count
Fix arg count parsing error in hw handlers. Cc: stable@kernel.org Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
-rw-r--r--drivers/md/dm-mpath.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index d880299..f25bdeb 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -705,6 +705,11 @@ static int parse_hw_handler(struct arg_set *as, struct multipath *m)
if (!hw_argc)
return 0;
+ if (hw_argc > as->argc) {
+ ti->error = "not enough arguments for hardware handler";
+ return -EINVAL;
+ }
+
m->hw_handler_name = kstrdup(shift(as), GFP_KERNEL);
request_module("scsi_dh_%s", m->hw_handler_name);
if (scsi_dh_handler_exist(m->hw_handler_name) == 0) {
OpenPOWER on IntegriCloud