]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
more 2.6.22 patches
authorGreg Kroah-Hartman <gregkh@suse.de>
Mon, 19 Nov 2007 17:47:55 +0000 (09:47 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 19 Nov 2007 17:47:55 +0000 (09:47 -0800)
queue-2.6.22/i2c-eeprom-hide-sony-vaio-serial-numbers.patch [new file with mode: 0644]
queue-2.6.22/i2c-eeprom-recognize-vgn-as-a-valid-sony-vaio-name-prefix.patch [new file with mode: 0644]
queue-2.6.22/i2c-pasemi-fix-nack-detection.patch [new file with mode: 0644]
queue-2.6.22/ocfs2-fix-write-performance-regression.patch [new file with mode: 0644]
queue-2.6.22/series

diff --git a/queue-2.6.22/i2c-eeprom-hide-sony-vaio-serial-numbers.patch b/queue-2.6.22/i2c-eeprom-hide-sony-vaio-serial-numbers.patch
new file mode 100644 (file)
index 0000000..d2c800d
--- /dev/null
@@ -0,0 +1,62 @@
+From khali@linux-fr.org  Mon Nov 19 09:45:36 2007
+From: Jean Delvare <khali@linux-fr.org>
+Date: Fri, 16 Nov 2007 10:34:17 +0100
+Subject: i2c/eeprom: Hide Sony Vaio serial numbers
+To: stable@kernel.org
+Message-ID: <20071116103417.530ae76d@hyperion.delvare>
+
+patch 0f2cbd38aa377e30df3b7602abed69464d1970aa in mainline.
+
+The sysfs interface to DMI data takes care to not make the system
+serial number and UUID world-readable, presumably due to privacy
+concerns. For consistency, we should not let the eeprom driver
+export these same strings to the world on Sony Vaio laptops.
+Instead, only make them readable by root, as we already do for BIOS
+passwords.
+
+Signed-off-by: Jean Delvare <khali@linux-fr.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/i2c/chips/eeprom.c |   23 +++++++++++++++--------
+ 1 file changed, 15 insertions(+), 8 deletions(-)
+
+--- a/drivers/i2c/chips/eeprom.c
++++ b/drivers/i2c/chips/eeprom.c
+@@ -125,13 +125,20 @@ static ssize_t eeprom_read(struct kobjec
+       for (slice = off >> 5; slice <= (off + count - 1) >> 5; slice++)
+               eeprom_update_client(client, slice);
+-      /* Hide Vaio security settings to regular users (16 first bytes) */
+-      if (data->nature == VAIO && off < 16 && !capable(CAP_SYS_ADMIN)) {
+-              size_t in_row1 = 16 - off;
+-              in_row1 = min(in_row1, count);
+-              memset(buf, 0, in_row1);
+-              if (count - in_row1 > 0)
+-                      memcpy(buf + in_row1, &data->data[16], count - in_row1);
++      /* Hide Vaio private settings to regular users:
++         - BIOS passwords: bytes 0x00 to 0x0f
++         - UUID: bytes 0x10 to 0x1f
++         - Serial number: 0xc0 to 0xdf */
++      if (data->nature == VAIO && !capable(CAP_SYS_ADMIN)) {
++              int i;
++
++              for (i = 0; i < count; i++) {
++                      if ((off + i <= 0x1f) ||
++                          (off + i >= 0xc0 && off + i <= 0xdf))
++                              buf[i] = 0;
++                      else
++                              buf[i] = data->data[off + i];
++              }
+       } else {
+               memcpy(buf, &data->data[off], count);
+       }
+@@ -202,7 +209,7 @@ static int eeprom_detect(struct i2c_adap
+                && i2c_smbus_read_byte(new_client) == 'G'
+                && i2c_smbus_read_byte(new_client) == '-') {
+                       dev_info(&new_client->dev, "Vaio EEPROM detected, "
+-                              "enabling password protection\n");
++                               "enabling privacy protection\n");
+                       data->nature = VAIO;
+               }
+       }
diff --git a/queue-2.6.22/i2c-eeprom-recognize-vgn-as-a-valid-sony-vaio-name-prefix.patch b/queue-2.6.22/i2c-eeprom-recognize-vgn-as-a-valid-sony-vaio-name-prefix.patch
new file mode 100644 (file)
index 0000000..ec50a65
--- /dev/null
@@ -0,0 +1,51 @@
+From khali@linux-fr.org  Mon Nov 19 09:46:02 2007
+From: Jean Delvare <khali@linux-fr.org>
+Date: Fri, 16 Nov 2007 10:37:55 +0100
+Subject: i2c/eeprom: Recognize VGN as a valid Sony Vaio name prefix
+To: stable@kernel.org
+Message-ID: <20071116103755.218494f2@hyperion.delvare>
+
+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;
diff --git a/queue-2.6.22/i2c-pasemi-fix-nack-detection.patch b/queue-2.6.22/i2c-pasemi-fix-nack-detection.patch
new file mode 100644 (file)
index 0000000..5578c1b
--- /dev/null
@@ -0,0 +1,47 @@
+From khali@linux-fr.org  Mon Nov 19 09:45:02 2007
+From: Jean Delvare <khali@linux-fr.org>
+Date: Fri, 16 Nov 2007 10:24:36 +0100
+Subject: i2c-pasemi: Fix NACK detection
+To: stable@kernel.org
+Cc: Olof Johansson <olof@lixom.net>
+Message-ID: <20071116102436.036f8727@hyperion.delvare>
+
+From: Jean Delvare <khali@linux-fr.org>
+
+patch be8a1f7cd4501c3b4b32543577a33aee6d2193ac in mainline.
+
+Turns out we don't actually check the status to see if there was a
+device out there to talk to, just if we had a timeout when doing so.
+
+Add the proper check, so we don't falsly think there are devices
+on the bus that are not there, etc.
+
+Signed-off-by: Olof Johansson <olof@lixom.net>
+Signed-off-by: Jean Delvare <khali@linux-fr.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/i2c/busses/i2c-pasemi.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/i2c/busses/i2c-pasemi.c
++++ b/drivers/i2c/busses/i2c-pasemi.c
+@@ -51,6 +51,7 @@ struct pasemi_smbus {
+ #define MRXFIFO_DATA_M        0x000000ff
+ #define SMSTA_XEN     0x08000000
++#define SMSTA_MTN     0x00200000
+ #define CTL_MRR               0x00000400
+ #define CTL_MTR               0x00000200
+@@ -98,6 +99,10 @@ static unsigned int pasemi_smb_waitready
+               status = reg_read(smbus, REG_SMSTA);
+       }
++      /* Got NACK? */
++      if (status & SMSTA_MTN)
++              return -ENXIO;
++
+       if (timeout < 0) {
+               dev_warn(&smbus->dev->dev, "Timeout, status 0x%08x\n", status);
+               reg_write(smbus, REG_SMSTA, status);
diff --git a/queue-2.6.22/ocfs2-fix-write-performance-regression.patch b/queue-2.6.22/ocfs2-fix-write-performance-regression.patch
new file mode 100644 (file)
index 0000000..09644e5
--- /dev/null
@@ -0,0 +1,68 @@
+From mark.fasheh@oracle.com  Mon Nov 19 09:43:53 2007
+From: Mark Fasheh <mark.fasheh@oracle.com>
+Date: Wed, 14 Nov 2007 13:33:27 -0800
+Subject: ocfs2: fix write() performance regression
+To: gregkh@suse.de
+Cc: stable@kernel.org
+Message-ID: <20071114213327.GN28607@ca-server1.us.oracle.com>
+Content-Disposition: inline
+
+
+From: Mark Fasheh <mfasheh@ca-build8.us.oracle.com>
+
+ocfs2: fix write() performance regression
+
+patch 4e9563fd55ff4479f2b118d0757d121dd0cfc39c in mainline.
+
+On file systems which don't support sparse files, Ocfs2_map_page_blocks()
+was reading blocks on appending writes. This caused write performance to
+suffer dramatically. Fix this by detecting an appending write on a nonsparse
+fs and skipping the read.
+
+Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/ocfs2/aops.c |   24 +++++++++++++++++++++++-
+ 1 file changed, 23 insertions(+), 1 deletion(-)
+
+--- a/fs/ocfs2/aops.c
++++ b/fs/ocfs2/aops.c
+@@ -661,6 +661,27 @@ static void ocfs2_clear_page_regions(str
+ }
+ /*
++ * Nonsparse file systems fully allocate before we get to the write
++ * code. This prevents ocfs2_write() from tagging the write as an
++ * allocating one, which means ocfs2_map_page_blocks() might try to
++ * read-in the blocks at the tail of our file. Avoid reading them by
++ * testing i_size against each block offset.
++ */
++static int ocfs2_should_read_blk(struct inode *inode, struct page *page,
++                               unsigned int block_start)
++{
++      u64 offset = page_offset(page) + block_start;
++
++      if (ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb)))
++              return 1;
++
++      if (i_size_read(inode) > offset)
++              return 1;
++
++      return 0;
++}
++
++/*
+  * Some of this taken from block_prepare_write(). We already have our
+  * mapping by now though, and the entire write will be allocating or
+  * it won't, so not much need to use BH_New.
+@@ -711,7 +732,8 @@ int ocfs2_map_page_blocks(struct page *p
+                       if (!buffer_uptodate(bh))
+                               set_buffer_uptodate(bh);
+               } else if (!buffer_uptodate(bh) && !buffer_delay(bh) &&
+-                   (block_start < from || block_end > to)) {
++                         ocfs2_should_read_blk(inode, page, block_start) &&
++                         (block_start < from || block_end > to)) {
+                       ll_rw_block(READ, 1, &bh);
+                       *wait_bh++=bh;
+               }
index ac4c9543ac048c18f12e9fe3957fa2ce876d2a32..e2c6193955e7dc0f410556f4ca92ff86f9a0e5f2 100644 (file)
@@ -20,3 +20,7 @@ fix-netlink-timeouts.patch
 fix-error-returns-in-sys_socketpair.patch
 fix-endianness-bug-in-u32-classifier.patch
 fix-crypto_alloc_comp-error-checking.patch
+ocfs2-fix-write-performance-regression.patch
+i2c-pasemi-fix-nack-detection.patch
+i2c-eeprom-hide-sony-vaio-serial-numbers.patch
+i2c-eeprom-recognize-vgn-as-a-valid-sony-vaio-name-prefix.patch