From: Guenter Roeck <linux@roeck-us.net>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH] hwmon: (nct7802) Fix integer overflow seen when writing voltage limits
Date: Mon, 06 Jul 2015 12:51:43 +0000 [thread overview]
Message-ID: <559A79DF.9000902@roeck-us.net> (raw)
In-Reply-To: <1436041578-14411-1-git-send-email-linux@roeck-us.net>
Hi Jean,
On 07/06/2015 04:46 AM, Jean Delvare wrote:
> On Sat, 4 Jul 2015 13:26:18 -0700, Guenter Roeck wrote:
>> Writing a large value into a voltage limit attribute can result
>> in an overflow due to an auto-conversion from unsigned long to
>> unsigned int.
>>
>> Cc: Constantine Shulyupin <const@MakeLinux.com>
>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>> ---
>> drivers/hwmon/nct7802.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/hwmon/nct7802.c b/drivers/hwmon/nct7802.c
>> index 658bc91033a2..457b0f2678a4 100644
>> --- a/drivers/hwmon/nct7802.c
>> +++ b/drivers/hwmon/nct7802.c
>> @@ -262,7 +262,7 @@ abort:
>> }
>>
>> static int nct7802_write_voltage(struct nct7802_data *data, int nr, int index,
>> - unsigned int voltage)
>> + unsigned long voltage)
>> {
>> int shift = 8 - REG_VOLTAGE_LIMIT_MSB_SHIFT[index - 1][nr];
>> int err;
>
> Good catch.
>
> Reviewed-by: Jean Delvare <jdelvare@suse.de>
>
Thanks!
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
prev parent reply other threads:[~2015-07-06 12:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-04 20:26 [lm-sensors] [PATCH] hwmon: (nct7802) Fix integer overflow seen when writing voltage limits Guenter Roeck
2015-07-06 11:46 ` Jean Delvare
2015-07-06 12:51 ` Guenter Roeck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=559A79DF.9000902@roeck-us.net \
--to=linux@roeck-us.net \
--cc=lm-sensors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.