]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
.34 patches
authorGreg Kroah-Hartman <gregkh@suse.de>
Tue, 3 Aug 2010 23:32:54 +0000 (16:32 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 3 Aug 2010 23:32:54 +0000 (16:32 -0700)
queue-2.6.34/arm-imx-gpio-add-spinlock-protection.patch [new file with mode: 0644]
queue-2.6.34/nfs-fix-a-typo-in-include-linux-nfs_fs.h.patch [new file with mode: 0644]
queue-2.6.34/parisc-led.c-fix-potential-stack-overflow-in-led_proc_write.patch [new file with mode: 0644]
queue-2.6.34/series

diff --git a/queue-2.6.34/arm-imx-gpio-add-spinlock-protection.patch b/queue-2.6.34/arm-imx-gpio-add-spinlock-protection.patch
new file mode 100644 (file)
index 0000000..c820637
--- /dev/null
@@ -0,0 +1,75 @@
+From 14cb0deb66fcfca8fdbef75da8c84b5405a8c767 Mon Sep 17 00:00:00 2001
+From: Baruch Siach <baruch@tkos.co.il>
+Date: Tue, 6 Jul 2010 14:03:22 +0300
+Subject: arm/imx/gpio: add spinlock protection
+
+From: Baruch Siach <baruch@tkos.co.il>
+
+commit 14cb0deb66fcfca8fdbef75da8c84b5405a8c767 upstream.
+
+The GPIO registers need protection from concurrent access for operations that
+are not atomic.
+
+Cc: Juergen Beisert <j.beisert@pengutronix.de>
+Cc: Daniel Mack <daniel@caiaq.de>
+Reported-by: rpkamiak@rockwellcollins.com
+Signed-off-by: Baruch Siach <baruch@tkos.co.il>
+Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/arm/plat-mxc/gpio.c              |    8 ++++++++
+ arch/arm/plat-mxc/include/mach/gpio.h |    1 +
+ 2 files changed, 9 insertions(+)
+
+--- a/arch/arm/plat-mxc/gpio.c
++++ b/arch/arm/plat-mxc/gpio.c
+@@ -215,13 +215,16 @@ static void _set_gpio_direction(struct g
+       struct mxc_gpio_port *port =
+               container_of(chip, struct mxc_gpio_port, chip);
+       u32 l;
++      unsigned long flags;
++      spin_lock_irqsave(&port->lock, flags);
+       l = __raw_readl(port->base + GPIO_GDIR);
+       if (dir)
+               l |= 1 << offset;
+       else
+               l &= ~(1 << offset);
+       __raw_writel(l, port->base + GPIO_GDIR);
++      spin_unlock_irqrestore(&port->lock, flags);
+ }
+ static void mxc_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+@@ -230,9 +233,12 @@ static void mxc_gpio_set(struct gpio_chi
+               container_of(chip, struct mxc_gpio_port, chip);
+       void __iomem *reg = port->base + GPIO_DR;
+       u32 l;
++      unsigned long flags;
++      spin_lock_irqsave(&port->lock, flags);
+       l = (__raw_readl(reg) & (~(1 << offset))) | (value << offset);
+       __raw_writel(l, reg);
++      spin_unlock_irqrestore(&port->lock, flags);
+ }
+ static int mxc_gpio_get(struct gpio_chip *chip, unsigned offset)
+@@ -286,6 +292,8 @@ int __init mxc_gpio_init(struct mxc_gpio
+               port[i].chip.base = i * 32;
+               port[i].chip.ngpio = 32;
++              spin_lock_init(&port[i].lock);
++
+               /* its a serious configuration bug when it fails */
+               BUG_ON( gpiochip_add(&port[i].chip) < 0 );
+--- a/arch/arm/plat-mxc/include/mach/gpio.h
++++ b/arch/arm/plat-mxc/include/mach/gpio.h
+@@ -36,6 +36,7 @@ struct mxc_gpio_port {
+       int virtual_irq_start;
+       struct gpio_chip chip;
+       u32 both_edges;
++      spinlock_t lock;
+ };
+ int mxc_gpio_init(struct mxc_gpio_port*, int);
diff --git a/queue-2.6.34/nfs-fix-a-typo-in-include-linux-nfs_fs.h.patch b/queue-2.6.34/nfs-fix-a-typo-in-include-linux-nfs_fs.h.patch
new file mode 100644 (file)
index 0000000..4d38363
--- /dev/null
@@ -0,0 +1,54 @@
+From 77a63f3d1e0a3e7ede8d10f569e8481b13ff47c5 Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+Date: Sun, 1 Aug 2010 13:40:40 -0400
+Subject: NFS: Fix a typo in include/linux/nfs_fs.h
+
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+
+commit 77a63f3d1e0a3e7ede8d10f569e8481b13ff47c5 upstream.
+
+nfs_commit_inode() needs to be defined irrespectively of whether or not
+we are supporting NFSv3 and NFSv4.
+
+Allow the compiler to optimise away code in the NFSv2-only case by
+converting it into an inlined stub function.
+
+Reported-and-tested-by: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/nfs/write.c         |    5 -----
+ include/linux/nfs_fs.h |    6 ++++++
+ 2 files changed, 6 insertions(+), 5 deletions(-)
+
+--- a/fs/nfs/write.c
++++ b/fs/nfs/write.c
+@@ -1443,11 +1443,6 @@ out_mark_dirty:
+       return ret;
+ }
+ #else
+-int nfs_commit_inode(struct inode *inode, int how)
+-{
+-      return 0;
+-}
+-
+ static int nfs_commit_unstable_pages(struct inode *inode, struct writeback_control *wbc)
+ {
+       return 0;
+--- a/include/linux/nfs_fs.h
++++ b/include/linux/nfs_fs.h
+@@ -482,6 +482,12 @@ extern int nfs_wb_page_cancel(struct ino
+ extern int  nfs_commit_inode(struct inode *, int);
+ extern struct nfs_write_data *nfs_commitdata_alloc(void);
+ extern void nfs_commit_free(struct nfs_write_data *wdata);
++#else
++static inline int
++nfs_commit_inode(struct inode *inode, int how)
++{
++      return 0;
++}
+ #endif
+ static inline int
diff --git a/queue-2.6.34/parisc-led.c-fix-potential-stack-overflow-in-led_proc_write.patch b/queue-2.6.34/parisc-led.c-fix-potential-stack-overflow-in-led_proc_write.patch
new file mode 100644 (file)
index 0000000..0ded5b2
--- /dev/null
@@ -0,0 +1,45 @@
+From 4b4fd27c0b5ec638a1f06ced9226fd95229dbbf0 Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Mon, 2 Aug 2010 22:46:41 +0200
+Subject: PARISC: led.c - fix potential stack overflow in led_proc_write()
+
+From: Helge Deller <deller@gmx.de>
+
+commit 4b4fd27c0b5ec638a1f06ced9226fd95229dbbf0 upstream.
+
+avoid potential stack overflow by correctly checking count parameter
+
+Reported-by: Ilja <ilja@netric.org>
+Signed-off-by: Helge Deller <deller@gmx.de>
+Acked-by: Kyle McMartin <kyle@mcmartin.ca>
+Cc: James E.J. Bottomley <jejb@parisc-linux.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/parisc/led.c |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/parisc/led.c
++++ b/drivers/parisc/led.c
+@@ -176,16 +176,18 @@ static ssize_t led_proc_write(struct fil
+       size_t count, loff_t *pos)
+ {
+       void *data = PDE(file->f_path.dentry->d_inode)->data;
+-      char *cur, lbuf[count + 1];
++      char *cur, lbuf[32];
+       int d;
+       if (!capable(CAP_SYS_ADMIN))
+               return -EACCES;
+-      memset(lbuf, 0, count + 1);
++      if (count >= sizeof(lbuf))
++              count = sizeof(lbuf)-1;
+       if (copy_from_user(lbuf, buf, count))
+               return -EFAULT;
++      lbuf[count] = 0;
+       cur = lbuf;
index a9c87a8338e7ec514e89d92c6a06f582327f9bca..b7c312da1e605c82b166fd7b7e4a2c5940bc9bcb 100644 (file)
@@ -1,3 +1,6 @@
 mm-fix-ia64-crash-when-gcore-reads-gate-area.patch
 nfs-kswapd-must-not-block-in-nfs_release_page.patch
+nfs-fix-a-typo-in-include-linux-nfs_fs.h.patch
 comedi-uncripple-8255-based-dio-subdevices.patch
+parisc-led.c-fix-potential-stack-overflow-in-led_proc_write.patch
+arm-imx-gpio-add-spinlock-protection.patch