summary refs log tree commit diff
path: root/drivers/char
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2019-02-22 22:55:30 +0300
committerCorey Minyard <cminyard@mvista.com>2019-02-22 14:59:25 -0600
commit038903593317691cf5f87ba1286627f5e8ab5660 (patch)
tree814065d11cddf10ce3abeb139e6509c5c50b01c3 /drivers/char
parent90b2d4f15ff737fc03432c44cbb741da32ce06c4 (diff)
downloadlinux-038903593317691cf5f87ba1286627f5e8ab5660.tar.gz
ipmi_si: Potential array underflow in hotmod_handler()
The "ival" variable needs to signed so that we don't read before the
start of the str[] array.  This would only happen the user passed in a
module parameter that was just comprised of space characters.

Fixes: e80444ae4fc3 ("ipmi_si: Switch hotmod to use a platform device")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Message-Id: <20190222195530.GA306@kadam>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/ipmi/ipmi_si_hotmod.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/char/ipmi/ipmi_si_hotmod.c b/drivers/char/ipmi/ipmi_si_hotmod.c
index 1433055a9705..03140f6cdf6f 100644
--- a/drivers/char/ipmi/ipmi_si_hotmod.c
+++ b/drivers/char/ipmi/ipmi_si_hotmod.c
@@ -187,7 +187,8 @@ static int hotmod_handler(const char *val, const struct kernel_param *kp)
 	char *str = kstrdup(val, GFP_KERNEL), *curr, *next;
 	int  rv;
 	struct ipmi_plat_data h;
-	unsigned int len, ival;
+	unsigned int len;
+	int ival;
 
 	if (!str)
 		return -ENOMEM;