login
Header Space

 
 

[patch 26/26] i2c/eeprom: Recognize VGN as a valid Sony Vaio name prefix

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>, <stable@...>
Cc: Justin Forbes <jmforbes@...>, Zwane Mwaikambo <zwane@...>, Theodore Ts'o <tytso@...>, Randy Dunlap <rdunlap@...>, Dave Jones <davej@...>, Chuck Wolber <chuckw@...>, Chris Wedgwood <reviews@...>, Michael Krufky <mkrufky@...>, Chuck Ebbert <cebbert@...>, Domenico Andreoli <cavokz@...>, <torvalds@...>, <akpm@...>, <alan@...>, Jean Delvare <khali@...>
Date: Monday, November 19, 2007 - 2:19 pm

2.6.22-stable review patch.  If anyone has any objections, please let us
know.

------------------
From: Jean Delvare <khali@linux-fr.org>

patch 8b925a3dd8a4d7451092cb9aa11da727ba69e0f0 in mainline.

Recent (i.e. 2005 and later) Sony Vaio laptops have names beginning
with VGN rather than PCG. Update the eeprom driver so that it
recognizes these.

Why this matters: the eeprom driver hides private data from the
EEPROMs it recognizes as Vaio EEPROMs (passwords, serial number...) so
if the driver fails to recognize a Vaio EEPROM as such, the private
data is exposed to the world.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/i2c/chips/eeprom.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

--- a/drivers/i2c/chips/eeprom.c
+++ b/drivers/i2c/chips/eeprom.c
@@ -202,12 +202,16 @@ static int eeprom_detect(struct i2c_adap
 		goto exit_kfree;
 
 	/* Detect the Vaio nature of EEPROMs.
-	   We use the "PCG-" prefix as the signature. */
+	   We use the "PCG-" or "VGN-" prefix as the signature. */
 	if (address == 0x57) {
-		if (i2c_smbus_read_byte_data(new_client, 0x80) == 'P'
-		 && i2c_smbus_read_byte(new_client) == 'C'
-		 && i2c_smbus_read_byte(new_client) == 'G'
-		 && i2c_smbus_read_byte(new_client) == '-') {
+		char name[4];
+
+		name[0] = i2c_smbus_read_byte_data(new_client, 0x80);
+		name[1] = i2c_smbus_read_byte(new_client);
+		name[2] = i2c_smbus_read_byte(new_client);
+		name[3] = i2c_smbus_read_byte(new_client);
+
+		if (!memcmp(name, "PCG-", 4) || !memcmp(name, "VGN-", 4)) {
 			dev_info(&new_client->dev, "Vaio EEPROM detected, "
 				 "enabling privacy protection\n");
 			data->nature = VAIO;

-- 
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/26] 2.6.22-stable review, Greg Kroah-Hartman, (Mon Nov 19, 2:17 pm)
Re: [patch 00/26] 2.6.22-stable review, Greg Kroah-Hartman, (Mon Nov 19, 2:22 pm)
[patch 26/26] i2c/eeprom: Recognize VGN as a valid Sony Vaio..., Greg Kroah-Hartman, (Mon Nov 19, 2:19 pm)
[patch 25/26] i2c/eeprom: Hide Sony Vaio serial numbers, Greg Kroah-Hartman, (Mon Nov 19, 2:19 pm)
[patch 23/26] ocfs2: fix write() performance regression, Greg Kroah-Hartman, (Mon Nov 19, 2:19 pm)
[patch 15/26] forcedeth msi bugfix, Greg Kroah-Hartman, (Mon Nov 19, 2:19 pm)
[patch 24/26] i2c-pasemi: Fix NACK detection, Greg Kroah-Hartman, (Mon Nov 19, 2:19 pm)
[patch 22/26] ide: fix serverworks.c UDMA regression, Greg Kroah-Hartman, (Mon Nov 19, 2:19 pm)
[patch 21/26] i4l: fix random freezes with AVM B1 drivers, Greg Kroah-Hartman, (Mon Nov 19, 2:19 pm)
[patch 18/26] USB: usbserial - fix potential deadlock betwee..., Greg Kroah-Hartman, (Mon Nov 19, 2:19 pm)
[patch 20/26] i4l: Fix random hard freeze with AVM c4 card, Greg Kroah-Hartman, (Mon Nov 19, 2:19 pm)
[patch 19/26] USB: mutual exclusion for EHCI init and port r..., Greg Kroah-Hartman, (Mon Nov 19, 2:19 pm)
[patch 17/26] USB: kobil_sct: trivial backport to fix libct, Greg Kroah-Hartman, (Mon Nov 19, 2:19 pm)
[patch 16/26] hptiop: avoid buffer overflow when returning s..., Greg Kroah-Hartman, (Mon Nov 19, 2:19 pm)
[patch 13/26] ALSA: hdsp - Fix zero division, Greg Kroah-Hartman, (Mon Nov 19, 2:19 pm)
[patch 14/26] ALSA: hda-codec - Add array terminator for dmi..., Greg Kroah-Hartman, (Mon Nov 19, 2:19 pm)
[patch 12/26] Fix crypto_alloc_comp() error checking., Greg Kroah-Hartman, (Mon Nov 19, 2:19 pm)
[patch 11/26] Fix endianness bug in U32 classifier., Greg Kroah-Hartman, (Mon Nov 19, 2:18 pm)
[patch 10/26] Fix error returns in sys_socketpair(), Greg Kroah-Hartman, (Mon Nov 19, 2:18 pm)
[patch 08/26] Fix TEQL oops., Greg Kroah-Hartman, (Mon Nov 19, 2:18 pm)
[patch 06/26] NETFILTER: nf_conntrack_tcp: fix connection re..., Greg Kroah-Hartman, (Mon Nov 19, 2:18 pm)
[patch 05/26] fix param_sysfs_builtin name length check, Greg Kroah-Hartman, (Mon Nov 19, 2:18 pm)
[patch 07/26] fix the softlockup watchdog to actually work, Greg Kroah-Hartman, (Mon Nov 19, 2:18 pm)
[patch 09/26] Fix netlink timeouts., Greg Kroah-Hartman, (Mon Nov 19, 2:18 pm)
[patch 03/26] x86: fix TSC clock source calibration error, Greg Kroah-Hartman, (Mon Nov 19, 2:18 pm)
[patch 04/26] writeback: dont propagate AOP_WRITEPAGE_ACTIVATE, Greg Kroah-Hartman, (Mon Nov 19, 2:18 pm)
[patch 01/26] SLUB: Fix memory leak by not reusing cpu_slab, Greg Kroah-Hartman, (Mon Nov 19, 2:18 pm)
[patch 02/26] Fix compat futex hangs., Greg Kroah-Hartman, (Mon Nov 19, 2:18 pm)
speck-geostationary