From: Greg Kroah-Hartman Date: Wed, 23 Jun 2010 20:45:23 +0000 (-0700) Subject: .27 patches X-Git-Tag: v2.6.31.14~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5b715c9487c7256812f14adbd8734e06ee3de883;p=thirdparty%2Fkernel%2Fstable-queue.git .27 patches --- diff --git a/queue-2.6.27/powerpc-fix-handling-of-strncmp-with-zero-len.patch b/queue-2.6.27/powerpc-fix-handling-of-strncmp-with-zero-len.patch new file mode 100644 index 00000000000..5ad73674c6c --- /dev/null +++ b/queue-2.6.27/powerpc-fix-handling-of-strncmp-with-zero-len.patch @@ -0,0 +1,49 @@ +From 637a99022fb119b90fb281715d13172f0394fc12 Mon Sep 17 00:00:00 2001 +From: Jeff Mahoney +Date: Wed, 17 Mar 2010 10:55:51 +0000 +Subject: powerpc: Fix handling of strncmp with zero len + +From: Jeff Mahoney + +commit 637a99022fb119b90fb281715d13172f0394fc12 upstream. + +Commit 0119536c, which added the assembly version of strncmp to +powerpc, mentions that it adds two instructions to the version from +boot/string.S to allow it to handle len=0. Unfortunately, it doesn't +always return 0 when that is the case. The length is passed in r5, but +the return value is passed back in r3. In certain cases, this will +happen to work. Otherwise it will pass back the address of the first +string as the return value. + +This patch lifts the len <= 0 handling code from memcpy to handle that +case. + +Reported by: Christian_Sellars@symantec.com +Signed-off-by: Jeff Mahoney +Signed-off-by: Benjamin Herrenschmidt +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/lib/string.S | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/arch/powerpc/lib/string.S ++++ b/arch/powerpc/lib/string.S +@@ -71,7 +71,7 @@ _GLOBAL(strcmp) + + _GLOBAL(strncmp) + PPC_LCMPI r5,0 +- beqlr ++ ble- 2f + mtctr r5 + addi r5,r3,-1 + addi r4,r4,-1 +@@ -82,6 +82,8 @@ _GLOBAL(strncmp) + beqlr 1 + bdnzt eq,1b + blr ++2: li r3,0 ++ blr + + _GLOBAL(strlen) + addi r4,r3,-1 diff --git a/queue-2.6.27/powerpc-oprofile-fix-potential-buffer-overrun-in-op_model_cell.c.patch b/queue-2.6.27/powerpc-oprofile-fix-potential-buffer-overrun-in-op_model_cell.c.patch new file mode 100644 index 00000000000..3036815a145 --- /dev/null +++ b/queue-2.6.27/powerpc-oprofile-fix-potential-buffer-overrun-in-op_model_cell.c.patch @@ -0,0 +1,31 @@ +From 238c1a78c957f3dc7cb848b161dcf4805793ed56 Mon Sep 17 00:00:00 2001 +From: Denis Kirjanov +Date: Tue, 1 Jun 2010 15:43:34 -0400 +Subject: powerpc/oprofile: fix potential buffer overrun in op_model_cell.c + +From: Denis Kirjanov + +commit 238c1a78c957f3dc7cb848b161dcf4805793ed56 upstream. + +Fix potential initial_lfsr buffer overrun. +Writing past the end of the buffer could happen when index == ENTRIES + +Signed-off-by: Denis Kirjanov +Signed-off-by: Robert Richter +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/oprofile/op_model_cell.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/powerpc/oprofile/op_model_cell.c ++++ b/arch/powerpc/oprofile/op_model_cell.c +@@ -821,7 +821,7 @@ static int calculate_lfsr(int n) + index = ENTRIES-1; + + /* make sure index is valid */ +- if ((index > ENTRIES) || (index < 0)) ++ if ((index >= ENTRIES) || (index < 0)) + index = ENTRIES-1; + + return initial_lfsr[index]; diff --git a/queue-2.6.27/powerpc-pseries-only-call-start-cpu-when-a-cpu-is-stopped.patch b/queue-2.6.27/powerpc-pseries-only-call-start-cpu-when-a-cpu-is-stopped.patch new file mode 100644 index 00000000000..3defec54e06 --- /dev/null +++ b/queue-2.6.27/powerpc-pseries-only-call-start-cpu-when-a-cpu-is-stopped.patch @@ -0,0 +1,45 @@ +From aef40e87d866355ffd279ab21021de733242d0d5 Mon Sep 17 00:00:00 2001 +From: Michael Neuling +Date: Wed, 28 Apr 2010 13:39:41 +0000 +Subject: powerpc/pseries: Only call start-cpu when a CPU is stopped + +From: Michael Neuling + +commit aef40e87d866355ffd279ab21021de733242d0d5 upstream. + +Currently we always call start-cpu irrespective of if the CPU is +stopped or not. Unfortunatley on POWER7, firmware seems to not like +start-cpu being called when a cpu already been started. This was not +the case on POWER6 and earlier. + +This patch checks to see if the CPU is stopped or not via an +query-cpu-stopped-state call, and only calls start-cpu on CPUs which +are stopped. + +This fixes a bug with kexec on POWER7 on PHYP where only the primary +thread would make it to the second kernel. + +Reported-by: Ankita Garg +Signed-off-by: Michael Neuling +Signed-off-by: Benjamin Herrenschmidt +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/platforms/pseries/smp.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/arch/powerpc/platforms/pseries/smp.c ++++ b/arch/powerpc/platforms/pseries/smp.c +@@ -84,6 +84,12 @@ static inline int __devinit smp_startup_ + + pcpu = get_hard_smp_processor_id(lcpu); + ++ /* Check to see if the CPU out of FW already for kexec */ ++ if (smp_query_cpu_stopped(pcpu) == QCSS_NOT_STOPPED){ ++ cpu_set(lcpu, of_spin_map); ++ return 1; ++ } ++ + /* Fixup atomic count: it exited inside IRQ handler. */ + task_thread_info(paca[lcpu].__current)->preempt_count = 0; + diff --git a/queue-2.6.27/series b/queue-2.6.27/series index 44ec4429461..9bb181c8823 100644 --- a/queue-2.6.27/series +++ b/queue-2.6.27/series @@ -1,3 +1,6 @@ libata-disable-atapi-an-by-default.patch nfsd-don-t-report-compiled-out-versions-as-present.patch arcnet-limit-com20020-pci-id-matches-for-sohard-cards.patch +powerpc-fix-handling-of-strncmp-with-zero-len.patch +powerpc-pseries-only-call-start-cpu-when-a-cpu-is-stopped.patch +powerpc-oprofile-fix-potential-buffer-overrun-in-op_model_cell.c.patch