From: Greg Kroah-Hartman Date: Mon, 26 Aug 2013 04:44:16 +0000 (-0700) Subject: 3.10-stable patches X-Git-Tag: v3.0.94~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7e86f3fc43d9ecb8821c854d3d1efd1c28a0241d;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: arc-strchr-breakage-in-big-endian-configuration.patch --- diff --git a/queue-3.10/arc-strchr-breakage-in-big-endian-configuration.patch b/queue-3.10/arc-strchr-breakage-in-big-endian-configuration.patch new file mode 100644 index 00000000000..161c404331b --- /dev/null +++ b/queue-3.10/arc-strchr-breakage-in-big-endian-configuration.patch @@ -0,0 +1,68 @@ +From b0f55f2a1a295c364be012e82dbab079a2454006 Mon Sep 17 00:00:00 2001 +From: Joern Rennecke +Date: Sat, 24 Aug 2013 12:03:06 +0530 +Subject: ARC: [lib] strchr breakage in Big-endian configuration + +From: Joern Rennecke + +commit b0f55f2a1a295c364be012e82dbab079a2454006 upstream. + +For a search buffer, 2 byte aligned, strchr() was returning pointer +outside of buffer (buf - 1) + +------------->8---------------- + // Input buffer (default 4 byte aigned) + char *buffer = "1AA_"; + + // actual search start (to mimick 2 byte alignment) + char *current_line = &(buffer[2]); + + // Character to search for + char c = 'A'; + + char *c_pos = strchr(current_line, c); + + printf("%s\n", c_pos) --> 'AA_' as oppose to 'A_' +------------->8---------------- + +Reported-by: Anton Kolesov +Debugged-by: Anton Kolesov +Cc: Noam Camus +Signed-off-by: Joern Rennecke +Signed-off-by: Vineet Gupta +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arc/lib/strchr-700.S | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/arch/arc/lib/strchr-700.S ++++ b/arch/arc/lib/strchr-700.S +@@ -39,9 +39,18 @@ ARC_ENTRY strchr + ld.a r2,[r0,4] + sub r12,r6,r7 + bic r12,r12,r6 ++#ifdef __LITTLE_ENDIAN__ + and r7,r12,r4 + breq r7,0,.Loop ; For speed, we want this branch to be unaligned. + b .Lfound_char ; Likewise this one. ++#else ++ and r12,r12,r4 ++ breq r12,0,.Loop ; For speed, we want this branch to be unaligned. ++ lsr_s r12,r12,7 ++ bic r2,r7,r6 ++ b.d .Lfound_char_b ++ and_s r2,r2,r12 ++#endif + ; /* We require this code address to be unaligned for speed... */ + .Laligned: + ld_s r2,[r0] +@@ -95,6 +104,7 @@ ARC_ENTRY strchr + lsr r7,r7,7 + + bic r2,r7,r6 ++.Lfound_char_b: + norm r2,r2 + sub_s r0,r0,4 + asr_s r2,r2,3 diff --git a/queue-3.10/series b/queue-3.10/series index dbb31f683f5..26e55e93917 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -34,3 +34,4 @@ tracing-kprobes-fail-to-unregister-if-probe-event-files-are-in-use.patch tracing-uprobes-fail-to-unregister-if-probe-event-files-are-in-use.patch ftrace-check-module-functions-being-traced-on-reload.patch xen-smp-initialize-ipi-vectors-before-marking-cpu-online.patch +arc-strchr-breakage-in-big-endian-configuration.patch