diff options
author | Guenter Roeck <linux@roeck-us.net> | 2012-01-16 16:51:47 -0500 |
---|---|---|
committer | Jean Delvare <khali@endymion.delvare> | 2012-01-16 16:51:47 -0500 |
commit | 6b101116ae445311031f3e9f91d3010d444b9845 (patch) | |
tree | 418e5369d31ebdf8aea6bfa4c012e7ac8702ded6 /drivers/hwmon | |
parent | 2fe28ab51d200121b9c39f9b34cf2d132fcf5de1 (diff) |
hwmon: (lm90) Add range check to set_update_interval
When writing the update_interval attribute, the parameter value was
not range checked, which could cause an integer overflow and result
in an arbitrary update interval. Fix by limiting the value range to
<0, 100000>.
Reported-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/lm90.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index bdfd675488ae..d2dd5f90496d 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c | |||
@@ -917,7 +917,7 @@ static ssize_t set_update_interval(struct device *dev, | |||
917 | return err; | 917 | return err; |
918 | 918 | ||
919 | mutex_lock(&data->update_lock); | 919 | mutex_lock(&data->update_lock); |
920 | lm90_set_convrate(client, data, val); | 920 | lm90_set_convrate(client, data, SENSORS_LIMIT(val, 0, 100000)); |
921 | mutex_unlock(&data->update_lock); | 921 | mutex_unlock(&data->update_lock); |
922 | 922 | ||
923 | return count; | 923 | return count; |