diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2009-06-22 10:12:10 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-02 16:50:35 -0700 |
commit | 12486dc1a586d69b07193e44e3ef1bc56fdb35f1 (patch) | |
tree | 0eedd1636bf0f53c5b95646289dd917ccddab9f8 /drivers | |
parent | f4c28b780c88c1d12e740a9b0b67b9375b173960 (diff) |
dm mpath: validate hw_handler argument count
commit e094f4f15f5169526c7200b9bde44b900548a81e upstream.
Fix arg count parsing error in hw handlers.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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 6a386ab4f7e..085c4fc9838 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -699,6 +699,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) { |