From: Chris Wright <chrisw@osdl.org>
To: linux-kernel@vger.kernel.org, stable@kernel.org,
Greg KH <greg@kroah.com>
Cc: Justin Forbes <jmforbes@linuxtx.org>,
Zwane Mwaikambo <zwane@arm.linux.org.uk>,
"Theodore Ts'o" <tytso@mit.edu>,
Randy Dunlap <rdunlap@xenotime.net>,
Dave Jones <davej@redhat.com>,
Chuck Wolber <chuckw@quantumlinux.com>,
torvalds@osdl.org, akpm@osdl.org, alan@lxorguk.ukuu.org.uk,
Jean Delvare <khali@linux-fr.org>, Yuan Mu <Ymu@winbond.com.tw>
Subject: [patch 21/23] [PATCH] hwmon: Fix missing boundary check when setting W83627THF in0 limits
Date: Tue, 22 Nov 2005 13:08:50 -0800 [thread overview]
Message-ID: <20051122210850.GV28140@shell0.pdx.osdl.net> (raw)
In-Reply-To: 20051122205223.099537000@localhost.localdomain
[-- Attachment #1: hwmon-w83627hf-missing-in0-limit-check.patch --]
[-- Type: text/plain, Size: 1318 bytes --]
-stable review patch. If anyone has any objections, please let us know.
------------------
Add SENSORS_LIMIT in store VCore limit functions. This fixes a potential
u8 overflow on out-of-range user input.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@osdl.org>
---
drivers/hwmon/w83627hf.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- linux-2.6.14.2.orig/drivers/hwmon/w83627hf.c
+++ linux-2.6.14.2/drivers/hwmon/w83627hf.c
@@ -454,7 +454,9 @@ static ssize_t store_regs_in_min0(struct
(w83627thf == data->type || w83637hf == data->type))
/* use VRM9 calculation */
- data->in_min[0] = (u8)(((val * 100) - 70000 + 244) / 488);
+ data->in_min[0] =
+ SENSORS_LIMIT(((val * 100) - 70000 + 244) / 488, 0,
+ 255);
else
/* use VRM8 (standard) calculation */
data->in_min[0] = IN_TO_REG(val);
@@ -479,7 +481,9 @@ static ssize_t store_regs_in_max0(struct
(w83627thf == data->type || w83637hf == data->type))
/* use VRM9 calculation */
- data->in_max[0] = (u8)(((val * 100) - 70000 + 244) / 488);
+ data->in_max[0] =
+ SENSORS_LIMIT(((val * 100) - 70000 + 244) / 488, 0,
+ 255);
else
/* use VRM8 (standard) calculation */
data->in_max[0] = IN_TO_REG(val);
--
next prev parent reply other threads:[~2005-11-22 21:10 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20051122205223.099537000@localhost.localdomain>
2005-11-22 21:06 ` [patch 05/23] [PATCH] VFS: Fix memory leak with file leases Chris Wright
2005-11-22 21:06 ` [patch 06/23] [PATCH] Generic HDLC WAN drivers - disable netif_carrier_off() Chris Wright
2005-11-22 21:06 ` [patch 07/23] [PATCH] [NETFILTER] PPTP helper: Fix endianness bug in GRE key / CallID NAT Chris Wright
2005-11-22 21:06 ` [patch 08/23] [PATCH] [NETFILTER] NAT: Fix module refcount dropping too far Chris Wright
2005-11-22 21:06 ` [patch 09/23] [PATCH] [NETFILTER] nf_queue: Fix Ooops when no queue handler registered Chris Wright
2005-11-22 21:06 ` [patch 10/23] [PATCH] [NETFILTER] refcount leak of proto when ctnetlink dumping tuple Chris Wright
2005-11-22 21:07 ` [patch 11/23] [PATCH] [NETFILTER] ctnetlink: check if protoinfo is present Chris Wright
2005-11-22 21:07 ` [patch 12/23] [PATCH] [NETFILTER] PPTP helper: fix PNS-PAC expectation call id Chris Wright
2005-11-22 21:08 ` [patch 13/23] [PATCH] [NETFILTER] ctnetlink: Fix oops when no ICMP ID info in message Chris Wright
2005-11-22 23:31 ` Krzysztof Oledzki
2005-11-23 0:10 ` Chris Wright
2005-11-23 6:59 ` Harald Welte
2005-11-23 19:17 ` Chris Wright
2005-11-22 21:08 ` [patch 14/23] [PATCH] [NETFILTER] ip_conntrack TCP: Accept SYN+PUSH like SYN Chris Wright
2005-11-22 21:08 ` [patch 15/23] [PATCH] [NETFILTER] ip_conntrack: fix ftp/irc/tftp helpers on ports >= 32768 Chris Wright
2005-11-22 21:08 ` [patch 16/23] [PATCH] [IPV6]: Fix memory management error during setting up new advapi sockopts Chris Wright
2005-11-22 21:08 ` [patch 17/23] [PATCH] [IPV6]: Fix calculation of AH length during filling ancillary data Chris Wright
2005-11-22 21:08 ` [patch 18/23] [PATCH] [IPV6]: Fix sending extension headers before and including routing header Chris Wright
2005-11-22 21:08 ` [patch 19/23] [PATCH] x86_64/i386: Compute correct MTRR mask on early Noconas Chris Wright
2005-11-22 21:08 ` [patch 20/23] drivers/isdn/hardware/eicon/os_4bri.c: correct the xdiLoadFile() signature Chris Wright
2005-11-22 21:08 ` Chris Wright [this message]
2005-11-22 21:08 ` [patch 22/23] hwmon: Fix lm78 VID conversion Chris Wright
2005-11-22 21:09 ` [patch 23/23] hwmon: Fix missing it87 fan div init Chris Wright
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=20051122210850.GV28140@shell0.pdx.osdl.net \
--to=chrisw@osdl.org \
--cc=Ymu@winbond.com.tw \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=chuckw@quantumlinux.com \
--cc=davej@redhat.com \
--cc=greg@kroah.com \
--cc=jmforbes@linuxtx.org \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@xenotime.net \
--cc=stable@kernel.org \
--cc=torvalds@osdl.org \
--cc=tytso@mit.edu \
--cc=zwane@arm.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox