From: Greg Kroah-Hartman Date: Tue, 3 Aug 2010 23:32:54 +0000 (-0700) Subject: .34 patches X-Git-Tag: v2.6.27.50~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f074242788f989b1862582325ee13b29b5c8990;p=thirdparty%2Fkernel%2Fstable-queue.git .34 patches --- 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 index 00000000000..c8206370982 --- /dev/null +++ b/queue-2.6.34/arm-imx-gpio-add-spinlock-protection.patch @@ -0,0 +1,75 @@ +From 14cb0deb66fcfca8fdbef75da8c84b5405a8c767 Mon Sep 17 00:00:00 2001 +From: Baruch Siach +Date: Tue, 6 Jul 2010 14:03:22 +0300 +Subject: arm/imx/gpio: add spinlock protection + +From: Baruch Siach + +commit 14cb0deb66fcfca8fdbef75da8c84b5405a8c767 upstream. + +The GPIO registers need protection from concurrent access for operations that +are not atomic. + +Cc: Juergen Beisert +Cc: Daniel Mack +Reported-by: rpkamiak@rockwellcollins.com +Signed-off-by: Baruch Siach +Signed-off-by: Sascha Hauer +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..4d383639f86 --- /dev/null +++ b/queue-2.6.34/nfs-fix-a-typo-in-include-linux-nfs_fs.h.patch @@ -0,0 +1,54 @@ +From 77a63f3d1e0a3e7ede8d10f569e8481b13ff47c5 Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Sun, 1 Aug 2010 13:40:40 -0400 +Subject: NFS: Fix a typo in include/linux/nfs_fs.h + +From: Trond Myklebust + +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 +Signed-off-by: Trond Myklebust +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..0ded5b20123 --- /dev/null +++ b/queue-2.6.34/parisc-led.c-fix-potential-stack-overflow-in-led_proc_write.patch @@ -0,0 +1,45 @@ +From 4b4fd27c0b5ec638a1f06ced9226fd95229dbbf0 Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Mon, 2 Aug 2010 22:46:41 +0200 +Subject: PARISC: led.c - fix potential stack overflow in led_proc_write() + +From: Helge Deller + +commit 4b4fd27c0b5ec638a1f06ced9226fd95229dbbf0 upstream. + +avoid potential stack overflow by correctly checking count parameter + +Reported-by: Ilja +Signed-off-by: Helge Deller +Acked-by: Kyle McMartin +Cc: James E.J. Bottomley +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + 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; + diff --git a/queue-2.6.34/series b/queue-2.6.34/series index a9c87a8338e..b7c312da1e6 100644 --- a/queue-2.6.34/series +++ b/queue-2.6.34/series @@ -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