From 7294b74b970a2fa110ae293ec02ffc2f9ac8276e Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Fri, 16 Nov 2007 08:48:06 +0000 Subject: [PATCH] Hide Sony Vaio serial number and UUID to regular users. This is a backport from Linux 2.6. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5019 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + kernel/chips/eeprom.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 4928727a..804af4b3 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,7 @@ lm_sensors CHANGES file SVN-HEAD Library: Fix fschrc and fschmd support Makefile: Revert changeset 4738, fix bug #2187 differently + Module eeprom: Hide Sony Vaio serial numbers to regular users (2.6 backport) Program decode-dimms.pl: Fix DDR2 SDRAM module speed decoding Update manufacturer IDs. Program sensors: Hide spurious errors on missing f71872f voltage inputs diff --git a/kernel/chips/eeprom.c b/kernel/chips/eeprom.c index 5a1d249a..1b70db2b 100644 --- a/kernel/chips/eeprom.c +++ b/kernel/chips/eeprom.c @@ -207,7 +207,7 @@ static int eeprom_detect(struct i2c_adapter *adapter, int address, && i2c_smbus_read_byte(new_client) == 'G' && i2c_smbus_read_byte(new_client) == '-') { printk(KERN_INFO "Vaio EEPROM detected, " - "enabling password protection\n"); + "enabling privacy protection\n"); data->nature = NATURE_VAIO; } } @@ -308,9 +308,13 @@ void eeprom_contents(struct i2c_client *client, int operation, *nrels_mag = 0; else if (operation == SENSORS_PROC_REAL_READ) { eeprom_update_client(client, nr >> 1); - /* Hide Vaio security settings to regular users */ - if (nr == 0 && data->nature == NATURE_VAIO - && !capable(CAP_SYS_ADMIN)) + /* Hide Vaio private settings to regular users: + - BIOS passwords: bytes 0x00 to 0x0f (row 0) + - UUID: bytes 0x10 to 0x1f (row 1) + - Serial number: 0xc0 to 0xdf (rows 12 and 13) */ + if (data->nature == NATURE_VAIO + && !capable(CAP_SYS_ADMIN) + && (nr == 0 || nr == 1 || nr == 12 || nr == 13)) for (i = 0; i < 16; i++) results[i] = 0; else