From: Greg Kroah-Hartman Date: Wed, 3 Feb 2010 02:15:36 +0000 (-0800) Subject: more .32 patches X-Git-Tag: v2.6.32.8~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6626e578504b34c276b029b493b334c5ec4335a0;p=thirdparty%2Fkernel%2Fstable-queue.git more .32 patches --- diff --git a/queue-2.6.32/block-fix-bugs-in-bio-integrity-mempool-usage.patch b/queue-2.6.32/block-fix-bugs-in-bio-integrity-mempool-usage.patch new file mode 100644 index 00000000000..56204f00a66 --- /dev/null +++ b/queue-2.6.32/block-fix-bugs-in-bio-integrity-mempool-usage.patch @@ -0,0 +1,45 @@ +From 9e9432c267e4047db98b9d4fba95099c6effcef9 Mon Sep 17 00:00:00 2001 +From: Chuck Ebbert +Date: Sat, 30 Jan 2010 20:28:19 +0100 +Subject: block: fix bugs in bio-integrity mempool usage + +From: Chuck Ebbert + +commit 9e9432c267e4047db98b9d4fba95099c6effcef9 upstream. + +Fix two bugs in the bio integrity code: + + use_bip_pool() always returns 0 because it checks against the wrong limit, + causing the mempool to be used only when regular allocation fails. + + When the mempool is used as a fallback we don't free the data properly. + +Signed-Off-By: Chuck Ebbert +Acked-by: Martin K. Petersen + +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + fs/bio-integrity.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/fs/bio-integrity.c ++++ b/fs/bio-integrity.c +@@ -61,7 +61,7 @@ static inline unsigned int vecs_to_idx(u + + static inline int use_bip_pool(unsigned int idx) + { +- if (idx == BIOVEC_NR_POOLS) ++ if (idx == BIOVEC_MAX_IDX) + return 1; + + return 0; +@@ -95,6 +95,7 @@ struct bio_integrity_payload *bio_integr + + /* Use mempool if lower order alloc failed or max vecs were requested */ + if (bip == NULL) { ++ idx = BIOVEC_MAX_IDX; /* so we free the payload properly later */ + bip = mempool_alloc(bs->bio_integrity_pool, gfp_mask); + + if (unlikely(bip == NULL)) { diff --git a/queue-2.6.32/fix-flush_old_exec-setup_new_exec-split.patch b/queue-2.6.32/fix-flush_old_exec-setup_new_exec-split.patch new file mode 100644 index 00000000000..a3e2f330b72 --- /dev/null +++ b/queue-2.6.32/fix-flush_old_exec-setup_new_exec-split.patch @@ -0,0 +1,71 @@ +From 7ab02af428c2d312c0cf8fb0b01cc1eb21131a3d Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Tue, 2 Feb 2010 12:37:44 -0800 +Subject: Fix 'flush_old_exec()/setup_new_exec()' split + +From: Linus Torvalds + +commit 7ab02af428c2d312c0cf8fb0b01cc1eb21131a3d upstream. + +Commit 221af7f87b9 ("Split 'flush_old_exec' into two functions") split +the function at the point of no return - ie right where there were no +more error cases to check. That made sense from a technical standpoint, +but when we then also combined it with the actual personality setting +going in between flush_old_exec() and setup_new_exec(), it needs to be a +bit more careful. + +In particular, we need to make sure that we really flush the old +personality bits in the 'flush' stage, rather than later in the 'setup' +stage, since otherwise we might be flushing the _new_ personality state +that we're just setting up. + +So this moves the flags and personality flushing (and 'flush_thread()', +which is the arch-specific function that generally resets lazy FP state +etc) of the old process into flush_old_exec(), so that it doesn't affect +any state that execve() is setting up for the new process environment. + +This was reported by Michal Simek as breaking his Microblaze qemu +environment. + +Reported-and-tested-by: Michal Simek +Cc: Peter Anvin +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/exec.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/fs/exec.c ++++ b/fs/exec.c +@@ -951,6 +951,11 @@ int flush_old_exec(struct linux_binprm * + goto out; + + bprm->mm = NULL; /* We're using it now */ ++ ++ current->flags &= ~PF_RANDOMIZE; ++ flush_thread(); ++ current->personality &= ~bprm->per_clear; ++ + return 0; + + out: +@@ -987,9 +992,6 @@ void setup_new_exec(struct linux_binprm + tcomm[i] = '\0'; + set_task_comm(current, tcomm); + +- current->flags &= ~PF_RANDOMIZE; +- flush_thread(); +- + /* Set the new mm task size. We have to do that late because it may + * depend on TIF_32BIT which is only updated in flush_thread() on + * some architectures like powerpc +@@ -1005,8 +1007,6 @@ void setup_new_exec(struct linux_binprm + set_dumpable(current->mm, suid_dumpable); + } + +- current->personality &= ~bprm->per_clear; +- + /* + * Flush performance counters when crossing a + * security domain: diff --git a/queue-2.6.32/random-drop-weird-m_time-a_time-manipulation.patch b/queue-2.6.32/random-drop-weird-m_time-a_time-manipulation.patch new file mode 100644 index 00000000000..ad96f150141 --- /dev/null +++ b/queue-2.6.32/random-drop-weird-m_time-a_time-manipulation.patch @@ -0,0 +1,48 @@ +From a996996dd75a9086b12d1cb4010f26e1748993f0 Mon Sep 17 00:00:00 2001 +From: Matt Mackall +Date: Fri, 29 Jan 2010 21:50:36 +1300 +Subject: random: drop weird m_time/a_time manipulation + +From: Matt Mackall + +commit a996996dd75a9086b12d1cb4010f26e1748993f0 upstream. + +No other driver does anything remotely like this that I know of except +for the tty drivers, and I can't see any reason for random/urandom to do +it. In fact, it's a (trivial, harmless) timing information leak. And +obviously, it generates power- and flash-cycle wasting I/O, especially +if combined with something like hwrngd. Also, it breaks ubifs's +expectations. + +Signed-off-by: Matt Mackall +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/char/random.c | 8 -------- + 1 file changed, 8 deletions(-) + +--- a/drivers/char/random.c ++++ b/drivers/char/random.c +@@ -1051,12 +1051,6 @@ random_read(struct file *file, char __us + /* like a named pipe */ + } + +- /* +- * If we gave the user some bytes, update the access time. +- */ +- if (count) +- file_accessed(file); +- + return (count ? count : retval); + } + +@@ -1116,8 +1110,6 @@ static ssize_t random_write(struct file + if (ret) + return ret; + +- inode->i_mtime = current_fs_time(inode->i_sb); +- mark_inode_dirty(inode); + return (ssize_t)count; + } + diff --git a/queue-2.6.32/random-remove-unused-inode-variable.patch b/queue-2.6.32/random-remove-unused-inode-variable.patch new file mode 100644 index 00000000000..7944ce086c4 --- /dev/null +++ b/queue-2.6.32/random-remove-unused-inode-variable.patch @@ -0,0 +1,26 @@ +From cd1510cb5f892907fe1a662f90b41fb3a42954e0 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Mon, 1 Feb 2010 21:48:28 +1100 +Subject: random: Remove unused inode variable + +From: Herbert Xu + +commit cd1510cb5f892907fe1a662f90b41fb3a42954e0 upstream. + +The previous changeset left behind an unused inode variable. +This patch removes it. + +Reported-by: Stephen Rothwell +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman + +--- a/drivers/char/random.c ++++ b/drivers/char/random.c +@@ -1101,7 +1101,6 @@ static ssize_t random_write(struct file *file, const char __user *buffer, + size_t count, loff_t *ppos) + { + size_t ret; +- struct inode *inode = file->f_path.dentry->d_inode; + + ret = write_pool(&blocking_pool, buffer, count); + if (ret) diff --git a/queue-2.6.32/series b/queue-2.6.32/series index 5cb135a7928..01c70402d0b 100644 --- a/queue-2.6.32/series +++ b/queue-2.6.32/series @@ -53,3 +53,8 @@ libata-retry-link-resume-if-necessary.patch mm-percpu-vmap-fix-rcu-list-walking.patch mm-purge-fragmented-percpu-vmap-blocks.patch block-fix-bio_add_page-for-non-trivial-merge_bvec_fn-case.patch +fix-flush_old_exec-setup_new_exec-split.patch +random-drop-weird-m_time-a_time-manipulation.patch +random-remove-unused-inode-variable.patch +block-fix-bugs-in-bio-integrity-mempool-usage.patch +usb-r8a66597-hdc-disable-interrupts-fix.patch diff --git a/queue-2.6.32/usb-r8a66597-hdc-disable-interrupts-fix.patch b/queue-2.6.32/usb-r8a66597-hdc-disable-interrupts-fix.patch new file mode 100644 index 00000000000..e4d59275ae7 --- /dev/null +++ b/queue-2.6.32/usb-r8a66597-hdc-disable-interrupts-fix.patch @@ -0,0 +1,58 @@ +From e5ff15bec96ba18698dae5de0bbf7e6a0653ca65 Mon Sep 17 00:00:00 2001 +From: Magnus Damm +Date: Wed, 27 Jan 2010 07:41:19 +0000 +Subject: usb: r8a66597-hdc disable interrupts fix + +From: Magnus Damm + +commit e5ff15bec96ba18698dae5de0bbf7e6a0653ca65 upstream. + +This patch improves disable_controller() in the r8a66597-hdc +driver to disable all interrupts and clear status flags. It +also makes sure that disable_controller() is called during +probe(). This fixes the relatively rare case of unexpected +pending interrupts after kexec reboot. + +Signed-off-by: Magnus Damm +Acked-by: Yoshihiro Shimoda +Signed-off-by: Paul Mundt +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/r8a66597-hcd.c | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +--- a/drivers/usb/host/r8a66597-hcd.c ++++ b/drivers/usb/host/r8a66597-hcd.c +@@ -216,8 +216,17 @@ static void disable_controller(struct r8 + { + int port; + ++ /* disable interrupts */ + r8a66597_write(r8a66597, 0, INTENB0); +- r8a66597_write(r8a66597, 0, INTSTS0); ++ r8a66597_write(r8a66597, 0, INTENB1); ++ r8a66597_write(r8a66597, 0, BRDYENB); ++ r8a66597_write(r8a66597, 0, BEMPENB); ++ r8a66597_write(r8a66597, 0, NRDYENB); ++ ++ /* clear status */ ++ r8a66597_write(r8a66597, 0, BRDYSTS); ++ r8a66597_write(r8a66597, 0, NRDYSTS); ++ r8a66597_write(r8a66597, 0, BEMPSTS); + + for (port = 0; port < r8a66597->max_root_hub; port++) + r8a66597_disable_port(r8a66597, port); +@@ -2470,6 +2479,12 @@ static int __devinit r8a66597_probe(stru + r8a66597->rh_timer.data = (unsigned long)r8a66597; + r8a66597->reg = (unsigned long)reg; + ++ /* make sure no interrupts are pending */ ++ ret = r8a66597_clock_enable(r8a66597); ++ if (ret < 0) ++ goto clean_up3; ++ disable_controller(r8a66597); ++ + for (i = 0; i < R8A66597_MAX_NUM_PIPE; i++) { + INIT_LIST_HEAD(&r8a66597->pipe_queue[i]); + init_timer(&r8a66597->td_timer[i]);