From: Greg Kroah-Hartman Date: Tue, 3 Aug 2010 23:34:35 +0000 (-0700) Subject: .32 patches X-Git-Tag: v2.6.27.50~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c21137fd4e3a38e7008c51d8f021cec1cbaae645;p=thirdparty%2Fkernel%2Fstable-queue.git .32 patches --- diff --git a/queue-2.6.32/arm-imx-gpio-add-spinlock-protection.patch b/queue-2.6.32/arm-imx-gpio-add-spinlock-protection.patch new file mode 100644 index 00000000000..a6d7abd257f --- /dev/null +++ b/queue-2.6.32/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 +@@ -223,13 +223,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) +@@ -238,9 +241,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) +@@ -294,6 +300,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.32/nfs-kswapd-must-not-block-in-nfs_release_page.patch b/queue-2.6.32/nfs-kswapd-must-not-block-in-nfs_release_page.patch new file mode 100644 index 00000000000..c88587120b9 --- /dev/null +++ b/queue-2.6.32/nfs-kswapd-must-not-block-in-nfs_release_page.patch @@ -0,0 +1,56 @@ +From stable-bounces@linux.kernel.org Tue Aug 3 16:23:06 2010 +From: Trond Myklebust +To: Greg KH , stable@kernel.org +Date: Tue, 3 Aug 2010 17:22:16 -0400 +Message-Id: <1280870536-21281-1-git-send-email-Trond.Myklebust@netapp.com> +Cc: Trond Myklebust +Subject: NFS: kswapd must not block in nfs_release_page + +commit b608b283a962caaa280756bc8563016a71712acf upstream + +See https://bugzilla.kernel.org/show_bug.cgi?id=16056 + +If other processes are blocked waiting for kswapd to free up some memory so +that they can make progress, then we cannot allow kswapd to block on those +processes. + +Signed-off-by: Trond Myklebust +Signed-off-by: Greg Kroah-Hartman + +--- + fs/nfs/file.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +--- a/fs/nfs/file.c ++++ b/fs/nfs/file.c +@@ -27,6 +27,8 @@ + #include + #include + #include ++#include ++#include + + #include + #include +@@ -484,11 +486,19 @@ static void nfs_invalidate_page(struct p + */ + static int nfs_release_page(struct page *page, gfp_t gfp) + { ++ struct address_space *mapping = page->mapping; ++ + dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page); + + /* Only do I/O if gfp is a superset of GFP_KERNEL */ +- if ((gfp & GFP_KERNEL) == GFP_KERNEL) +- nfs_wb_page(page->mapping->host, page); ++ if (mapping && (gfp & GFP_KERNEL) == GFP_KERNEL) { ++ int how = FLUSH_SYNC; ++ ++ /* Don't let kswapd deadlock waiting for OOM RPC calls */ ++ if (current_is_kswapd()) ++ how = 0; ++ nfs_commit_inode(mapping->host, how); ++ } + /* If PagePrivate() is set, then the page is not freeable */ + if (PagePrivate(page)) + return 0; diff --git a/queue-2.6.32/parisc-led.c-fix-potential-stack-overflow-in-led_proc_write.patch b/queue-2.6.32/parisc-led.c-fix-potential-stack-overflow-in-led_proc_write.patch new file mode 100644 index 00000000000..c8666161c8d --- /dev/null +++ b/queue-2.6.32/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 +@@ -182,16 +182,18 @@ static int led_proc_read(char *page, cha + static int led_proc_write(struct file *file, const char *buf, + unsigned long count, void *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.32/series b/queue-2.6.32/series index 01b27eb6cc6..99d8401b9b3 100644 --- a/queue-2.6.32/series +++ b/queue-2.6.32/series @@ -2,3 +2,6 @@ sched-cgroup-implement-different-treatment-for-idle-shares.patch mm-fix-ia64-crash-when-gcore-reads-gate-area.patch acl-trouble-after-upgrading-ubuntu.patch comedi-uncripple-8255-based-dio-subdevices.patch +nfs-kswapd-must-not-block-in-nfs_release_page.patch +parisc-led.c-fix-potential-stack-overflow-in-led_proc_write.patch +arm-imx-gpio-add-spinlock-protection.patch