diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2009-06-22 05:12:10 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-06-22 05:12:10 -0400 |
commit | e094f4f15f5169526c7200b9bde44b900548a81e (patch) | |
tree | 5ca573d45371779a183276066578bed1f38f11c6 /drivers | |
parent | 0e0497c0c017664994819f4602dc07fd95896c52 (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/dm-mpath.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index d880299334e9..f25bdebcb4ab 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) | |||
705 | if (!hw_argc) | 705 | if (!hw_argc) |
706 | return 0; | 706 | return 0; |
707 | 707 | ||
708 | if (hw_argc > as->argc) { | ||
709 | ti->error = "not enough arguments for hardware handler"; | ||
710 | return -EINVAL; | ||
711 | } | ||
712 | |||
708 | m->hw_handler_name = kstrdup(shift(as), GFP_KERNEL); | 713 | m->hw_handler_name = kstrdup(shift(as), GFP_KERNEL); |
709 | request_module("scsi_dh_%s", m->hw_handler_name); | 714 | request_module("scsi_dh_%s", m->hw_handler_name); |
710 | if (scsi_dh_handler_exist(m->hw_handler_name) == 0) { | 715 | if (scsi_dh_handler_exist(m->hw_handler_name) == 0) { |