]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
.38 patches
authorGreg Kroah-Hartman <gregkh@suse.de>
Mon, 11 Apr 2011 23:24:37 +0000 (16:24 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 11 Apr 2011 23:24:37 +0000 (16:24 -0700)
queue-2.6.38/atm-solos-pci-don-t-flap-vcs-when-carrier-state-changes.patch [new file with mode: 0644]
queue-2.6.38/atm-solos-pci-don-t-include-frame-pseudo-header-on-transmit-hex-dump.patch [new file with mode: 0644]
queue-2.6.38/series
queue-2.6.38/squashfs-handle-corruption-of-directory-structure.patch [new file with mode: 0644]
queue-2.6.38/squashfs-use-vmalloc-rather-than-kmalloc-for-zlib-workspace.patch [new file with mode: 0644]

diff --git a/queue-2.6.38/atm-solos-pci-don-t-flap-vcs-when-carrier-state-changes.patch b/queue-2.6.38/atm-solos-pci-don-t-flap-vcs-when-carrier-state-changes.patch
new file mode 100644 (file)
index 0000000..2f88e93
--- /dev/null
@@ -0,0 +1,105 @@
+From c031235b395433350f25943b7580a5e343c7b7b2 Mon Sep 17 00:00:00 2001
+From: Philip A. Prindeville <philipp@redfish-solutions.com>
+Date: Wed, 30 Mar 2011 13:17:04 +0000
+Subject: atm/solos-pci: Don't flap VCs when carrier state changes
+
+From: Philip A. Prindeville <philipp@redfish-solutions.com>
+
+commit c031235b395433350f25943b7580a5e343c7b7b2 upstream.
+
+Don't flap VCs when carrier state changes; higher-level protocols
+can detect loss of connectivity and act accordingly. This is more
+consistent with how other network interfaces work.
+
+We no longer use release_vccs() so we can delete it.
+
+release_vccs() was duplicated from net/atm/common.c; make the
+corresponding function exported, since other code duplicates it
+and could leverage it if it were public.
+
+Signed-off-by: Philip A. Prindeville <philipp@redfish-solutions.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/atm/solos-pci.c |   26 +-------------------------
+ include/linux/atmdev.h  |    1 +
+ net/atm/common.c        |    1 +
+ 3 files changed, 3 insertions(+), 25 deletions(-)
+
+--- a/drivers/atm/solos-pci.c
++++ b/drivers/atm/solos-pci.c
+@@ -165,7 +165,6 @@ static uint32_t fpga_tx(struct solos_car
+ static irqreturn_t solos_irq(int irq, void *dev_id);
+ static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci);
+ static int list_vccs(int vci);
+-static void release_vccs(struct atm_dev *dev);
+ static int atm_init(struct solos_card *, struct device *);
+ static void atm_remove(struct solos_card *);
+ static int send_command(struct solos_card *card, int dev, const char *buf, size_t size);
+@@ -384,7 +383,6 @@ static int process_status(struct solos_c
+       /* Anything but 'Showtime' is down */
+       if (strcmp(state_str, "Showtime")) {
+               atm_dev_signal_change(card->atmdev[port], ATM_PHY_SIG_LOST);
+-              release_vccs(card->atmdev[port]);
+               dev_info(&card->dev->dev, "Port %d: %s\n", port, state_str);
+               return 0;
+       }
+@@ -830,28 +828,6 @@ static int list_vccs(int vci)
+       return num_found;
+ }
+-static void release_vccs(struct atm_dev *dev)
+-{
+-        int i;
+-
+-        write_lock_irq(&vcc_sklist_lock);
+-        for (i = 0; i < VCC_HTABLE_SIZE; i++) {
+-                struct hlist_head *head = &vcc_hash[i];
+-                struct hlist_node *node, *tmp;
+-                struct sock *s;
+-                struct atm_vcc *vcc;
+-
+-                sk_for_each_safe(s, node, tmp, head) {
+-                        vcc = atm_sk(s);
+-                        if (vcc->dev == dev) {
+-                                vcc_release_async(vcc, -EPIPE);
+-                                sk_del_node_init(s);
+-                        }
+-                }
+-        }
+-        write_unlock_irq(&vcc_sklist_lock);
+-}
+-
+ static int popen(struct atm_vcc *vcc)
+ {
+@@ -1269,7 +1245,7 @@ static int atm_init(struct solos_card *c
+               card->atmdev[i]->ci_range.vci_bits = 16;
+               card->atmdev[i]->dev_data = card;
+               card->atmdev[i]->phy_data = (void *)(unsigned long)i;
+-              atm_dev_signal_change(card->atmdev[i], ATM_PHY_SIG_UNKNOWN);
++              atm_dev_signal_change(card->atmdev[i], ATM_PHY_SIG_FOUND);
+               skb = alloc_skb(sizeof(*header), GFP_ATOMIC);
+               if (!skb) {
+--- a/include/linux/atmdev.h
++++ b/include/linux/atmdev.h
+@@ -443,6 +443,7 @@ void atm_dev_signal_change(struct atm_de
+ void vcc_insert_socket(struct sock *sk);
++void atm_dev_release_vccs(struct atm_dev *dev);
+ /*
+  * This is approximately the algorithm used by alloc_skb.
+--- a/net/atm/common.c
++++ b/net/atm/common.c
+@@ -252,6 +252,7 @@ void atm_dev_release_vccs(struct atm_dev
+       }
+       write_unlock_irq(&vcc_sklist_lock);
+ }
++EXPORT_SYMBOL(atm_dev_release_vccs);
+ static int adjust_tp(struct atm_trafprm *tp, unsigned char aal)
+ {
diff --git a/queue-2.6.38/atm-solos-pci-don-t-include-frame-pseudo-header-on-transmit-hex-dump.patch b/queue-2.6.38/atm-solos-pci-don-t-include-frame-pseudo-header-on-transmit-hex-dump.patch
new file mode 100644 (file)
index 0000000..f6a4407
--- /dev/null
@@ -0,0 +1,53 @@
+From 18b429e74eeafe42e947b1b0f9a760c7153a0b5c Mon Sep 17 00:00:00 2001
+From: Philip A. Prindeville <philipp@redfish-solutions.com>
+Date: Wed, 30 Mar 2011 12:59:26 +0000
+Subject: atm/solos-pci: Don't include frame pseudo-header on transmit hex-dump
+
+From: Philip A. Prindeville <philipp@redfish-solutions.com>
+
+commit 18b429e74eeafe42e947b1b0f9a760c7153a0b5c upstream.
+
+Omit pkt_hdr preamble when dumping transmitted packet as hex-dump;
+we can pull this up because the frame has already been sent, and
+dumping it is the last thing we do with it before freeing it.
+
+Also include the size, vpi, and vci in the debug as is done on
+receive.
+
+Use "port" consistently instead of "device" intermittently.
+
+Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/atm/solos-pci.c |    9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/drivers/atm/solos-pci.c
++++ b/drivers/atm/solos-pci.c
+@@ -697,7 +697,7 @@ void solos_bh(unsigned long card_arg)
+                                             size);
+                       }
+                       if (atmdebug) {
+-                              dev_info(&card->dev->dev, "Received: device %d\n", port);
++                              dev_info(&card->dev->dev, "Received: port %d\n", port);
+                               dev_info(&card->dev->dev, "size: %d VPI: %d VCI: %d\n",
+                                        size, le16_to_cpu(header->vpi),
+                                        le16_to_cpu(header->vci));
+@@ -1018,8 +1018,15 @@ static uint32_t fpga_tx(struct solos_car
+                       /* Clean up and free oldskb now it's gone */
+                       if (atmdebug) {
++                              struct pkt_hdr *header = (void *)oldskb->data;
++                              int size = le16_to_cpu(header->size);
++
++                              skb_pull(oldskb, sizeof(*header));
+                               dev_info(&card->dev->dev, "Transmitted: port %d\n",
+                                        port);
++                              dev_info(&card->dev->dev, "size: %d VPI: %d VCI: %d\n",
++                                       size, le16_to_cpu(header->vpi),
++                                       le16_to_cpu(header->vci));
+                               print_buffer(oldskb);
+                       }
index 7a28181a89172d5861ee2499b7c461024b0fec0f..3c5ef8f03a530521ccf976d1d59f83a94ec4c0c2 100644 (file)
@@ -95,3 +95,7 @@ sound-oss-remove-offset-from-load_patch-callbacks.patch
 drivers-media-video-tlg2300-pd-video.c-remove-second-mutex_unlock-in-pd_vidioc_s_fmt.patch
 acer-wmi-does-not-set-persistence-state-by-rfkill_init_sw_state.patch
 revert-x86-cleanup-highmap-after-brk-is-concluded.patch
+squashfs-use-vmalloc-rather-than-kmalloc-for-zlib-workspace.patch
+squashfs-handle-corruption-of-directory-structure.patch
+atm-solos-pci-don-t-include-frame-pseudo-header-on-transmit-hex-dump.patch
+atm-solos-pci-don-t-flap-vcs-when-carrier-state-changes.patch
diff --git a/queue-2.6.38/squashfs-handle-corruption-of-directory-structure.patch b/queue-2.6.38/squashfs-handle-corruption-of-directory-structure.patch
new file mode 100644 (file)
index 0000000..54c4606
--- /dev/null
@@ -0,0 +1,91 @@
+From 44cff8a9ee8a974f9e931df910688e7fc1f0b0f9 Mon Sep 17 00:00:00 2001
+From: Phillip Lougher <phillip@lougher.demon.co.uk>
+Date: Tue, 15 Mar 2011 22:09:55 +0000
+Subject: Squashfs: handle corruption of directory structure
+
+From: Phillip Lougher <phillip@lougher.demon.co.uk>
+
+commit 44cff8a9ee8a974f9e931df910688e7fc1f0b0f9 upstream.
+
+Handle the rare case where a directory metadata block is uncompressed and
+corrupted, leading to a kernel oops in directory scanning (memcpy).
+Normally corruption is detected at the decompression stage and dealt with
+then, however, this will not happen if:
+
+- metadata isn't compressed (users can optionally request no metadata
+  compression), or
+- the compressed metadata block was larger than the original, in which
+  case the uncompressed version was used, or
+- the data was corrupt after decompression
+
+This patch fixes this by adding some sanity checks against known maximum
+values.
+
+Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/squashfs/dir.c   |    9 +++++++++
+ fs/squashfs/namei.c |   12 ++++++++++++
+ 2 files changed, 21 insertions(+)
+
+--- a/fs/squashfs/dir.c
++++ b/fs/squashfs/dir.c
+@@ -172,6 +172,11 @@ static int squashfs_readdir(struct file
+               length += sizeof(dirh);
+               dir_count = le32_to_cpu(dirh.count) + 1;
++
++              /* dir_count should never be larger than 256 */
++              if (dir_count > 256)
++                      goto failed_read;
++
+               while (dir_count--) {
+                       /*
+                        * Read directory entry.
+@@ -183,6 +188,10 @@ static int squashfs_readdir(struct file
+                       size = le16_to_cpu(dire->size) + 1;
++                      /* size should never be larger than SQUASHFS_NAME_LEN */
++                      if (size > SQUASHFS_NAME_LEN)
++                              goto failed_read;
++
+                       err = squashfs_read_metadata(inode->i_sb, dire->name,
+                                       &block, &offset, size);
+                       if (err < 0)
+--- a/fs/squashfs/namei.c
++++ b/fs/squashfs/namei.c
+@@ -176,6 +176,11 @@ static struct dentry *squashfs_lookup(st
+               length += sizeof(dirh);
+               dir_count = le32_to_cpu(dirh.count) + 1;
++
++              /* dir_count should never be larger than 256 */
++              if (dir_count > 256)
++                      goto data_error;
++
+               while (dir_count--) {
+                       /*
+                        * Read directory entry.
+@@ -187,6 +192,10 @@ static struct dentry *squashfs_lookup(st
+                       size = le16_to_cpu(dire->size) + 1;
++                      /* size should never be larger than SQUASHFS_NAME_LEN */
++                      if (size > SQUASHFS_NAME_LEN)
++                              goto data_error;
++
+                       err = squashfs_read_metadata(dir->i_sb, dire->name,
+                                       &block, &offset, size);
+                       if (err < 0)
+@@ -228,6 +237,9 @@ exit_lookup:
+       d_add(dentry, inode);
+       return ERR_PTR(0);
++data_error:
++      err = -EIO;
++
+ read_failure:
+       ERROR("Unable to read directory block [%llx:%x]\n",
+               squashfs_i(dir)->start + msblk->directory_table,
diff --git a/queue-2.6.38/squashfs-use-vmalloc-rather-than-kmalloc-for-zlib-workspace.patch b/queue-2.6.38/squashfs-use-vmalloc-rather-than-kmalloc-for-zlib-workspace.patch
new file mode 100644 (file)
index 0000000..4de09c3
--- /dev/null
@@ -0,0 +1,50 @@
+From 117a91e0f25fd7698e20ac3dfa62086be3dc82a3 Mon Sep 17 00:00:00 2001
+From: Phillip Lougher <phillip@lougher.demon.co.uk>
+Date: Tue, 22 Mar 2011 23:01:26 +0000
+Subject: Squashfs: Use vmalloc rather than kmalloc for zlib workspace
+
+From: Phillip Lougher <phillip@lougher.demon.co.uk>
+
+commit 117a91e0f25fd7698e20ac3dfa62086be3dc82a3 upstream.
+
+Bugzilla bug 31422 reports occasional "page allocation failure. order:4"
+at Squashfs mount time.  Fix this by making zlib workspace allocation
+use vmalloc rather than kmalloc.
+
+Reported-by: Mehmet Giritli <mehmet@giritli.eu>
+Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/squashfs/zlib_wrapper.c |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/fs/squashfs/zlib_wrapper.c
++++ b/fs/squashfs/zlib_wrapper.c
+@@ -26,6 +26,7 @@
+ #include <linux/buffer_head.h>
+ #include <linux/slab.h>
+ #include <linux/zlib.h>
++#include <linux/vmalloc.h>
+ #include "squashfs_fs.h"
+ #include "squashfs_fs_sb.h"
+@@ -37,8 +38,7 @@ static void *zlib_init(struct squashfs_s
+       z_stream *stream = kmalloc(sizeof(z_stream), GFP_KERNEL);
+       if (stream == NULL)
+               goto failed;
+-      stream->workspace = kmalloc(zlib_inflate_workspacesize(),
+-              GFP_KERNEL);
++      stream->workspace = vmalloc(zlib_inflate_workspacesize());
+       if (stream->workspace == NULL)
+               goto failed;
+@@ -56,7 +56,7 @@ static void zlib_free(void *strm)
+       z_stream *stream = strm;
+       if (stream)
+-              kfree(stream->workspace);
++              vfree(stream->workspace);
+       kfree(stream);
+ }