* [PATCH] ipmi_si: Potential array underflow in hotmod_handler()
@ 2019-02-22 19:55 Dan Carpenter
2019-02-22 21:00 ` [PATCH] ipmi_si: Potential array underflow in hotmod_handler()y Corey Minyard
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-02-22 19:55 UTC (permalink / raw)
To: kernel-janitors
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>
---
drivers/char/ipmi/ipmi_si_hotmod.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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;
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ipmi_si: Potential array underflow in hotmod_handler()y
2019-02-22 19:55 [PATCH] ipmi_si: Potential array underflow in hotmod_handler() Dan Carpenter
@ 2019-02-22 21:00 ` Corey Minyard
0 siblings, 0 replies; 2+ messages in thread
From: Corey Minyard @ 2019-02-22 21:00 UTC (permalink / raw)
To: kernel-janitors
On Fri, Feb 22, 2019 at 10:55:30PM +0300, Dan Carpenter wrote:
> 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.
That was quick, I just uploaded that to linux-next yesterday. Thanks
for this, yes you are right. Added to my queue.
-corey
>
> Fixes: e80444ae4fc3 ("ipmi_si: Switch hotmod to use a platform device")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/char/ipmi/ipmi_si_hotmod.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> 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;
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-02-22 21:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-22 19:55 [PATCH] ipmi_si: Potential array underflow in hotmod_handler() Dan Carpenter
2019-02-22 21:00 ` [PATCH] ipmi_si: Potential array underflow in hotmod_handler()y Corey Minyard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).