Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2993975AbbHHW1m (ORCPT ); Sat, 8 Aug 2015 18:27:42 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36520 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2993575AbbHHWSL (ORCPT ); Sat, 8 Aug 2015 18:18:11 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Constantine Shulyupin , Jean Delvare , Guenter Roeck Subject: [PATCH 4.1 102/123] hwmon: (nct7802) Fix integer overflow seen when writing voltage limits Date: Sat, 8 Aug 2015 15:09:40 -0700 Message-Id: <20150808220721.238291825@linuxfoundation.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <20150808220717.771230091@linuxfoundation.org> References: <20150808220717.771230091@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1186 Lines: 39 4.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Guenter Roeck commit 9200bc4c28cd8992eb5379345abd6b4f0c93df16 upstream. 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 Reviewed-by: Jean Delvare Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- drivers/hwmon/nct7802.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/hwmon/nct7802.c +++ b/drivers/hwmon/nct7802.c @@ -195,7 +195,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; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/