From e094f4f15f5169526c7200b9bde44b900548a81e Mon Sep 17 00:00:00 2001 From: Mikulas Patocka Date: Mon, 22 Jun 2009 10:12:10 +0100 Subject: [RHEL5.7 PATCH 10/08] dm mpath: validate hw_handler argument count BZ 673058 Upstream commit e094f4f15f5169526c7200b9bde44b900548a81e Author: Mikulas Patocka Date: Mon Jun 22 10:12:10 2009 +0100 dm mpath: validate hw_handler argument count Fix arg count parsing error in hw handlers. Cc: stable@kernel.org Signed-off-by: Mikulas Patocka Signed-off-by: Alasdair G Kergon --- drivers/md/dm-mpath.c | 5 +++++ 1 file changed, 5 insertions(+) Index: linux-rhel5/drivers/md/dm-mpath.c =================================================================== --- linux-rhel5.orig/drivers/md/dm-mpath.c +++ linux-rhel5/drivers/md/dm-mpath.c @@ -742,6 +742,11 @@ static int parse_hw_handler(struct arg_s 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)) {