From: Greg Kroah-Hartman Date: Tue, 14 Feb 2012 17:23:19 +0000 (-0800) Subject: 3.2-stable patches X-Git-Tag: v3.0.22~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6316c262d8a27742f3599d95c156784c829bdde1;p=thirdparty%2Fkernel%2Fstable-queue.git 3.2-stable patches added patches: cifs-don-t-return-error-from-standard_receive3-after.patch cifs-request-oplock-when-doing-open-on-lookup.patch crypto-sha512-avoid-stack-bloat-on-i386.patch crypto-sha512-use-binary-and-instead-of-modulus.patch --- diff --git a/queue-3.2/cifs-don-t-return-error-from-standard_receive3-after.patch b/queue-3.2/cifs-don-t-return-error-from-standard_receive3-after.patch new file mode 100644 index 00000000000..74017b38c0e --- /dev/null +++ b/queue-3.2/cifs-don-t-return-error-from-standard_receive3-after.patch @@ -0,0 +1,48 @@ +From ff4fa4a25a33f92b5653bb43add0c63bea98d464 Mon Sep 17 00:00:00 2001 +From: Jeff Layton +Date: Tue, 7 Feb 2012 06:31:05 -0500 +Subject: cifs: don't return error from standard_receive3 after + marking response malformed + +From: Jeff Layton + +commit ff4fa4a25a33f92b5653bb43add0c63bea98d464 upstream. + +standard_receive3 will check the validity of the response from the +server (via checkSMB). It'll pass the result of that check to handle_mid +which will dequeue it and mark it with a status of +MID_RESPONSE_MALFORMED if checkSMB returned an error. At that point, +standard_receive3 will also return an error, which will make the +demultiplex thread skip doing the callback for the mid. + +This is wrong -- if we were able to identify the request and the +response is marked malformed, then we want the demultiplex thread to do +the callback. Fix this by making standard_receive3 return 0 in this +situation. + +Reported-and-Tested-by: Mark Moseley +Signed-off-by: Jeff Layton +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman + +--- + fs/cifs/connect.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/fs/cifs/connect.c ++++ b/fs/cifs/connect.c +@@ -756,10 +756,11 @@ standard_receive3(struct TCP_Server_Info + cifs_dump_mem("Bad SMB: ", buf, + min_t(unsigned int, server->total_read, 48)); + +- if (mid) +- handle_mid(mid, server, smb_buffer, length); ++ if (!mid) ++ return length; + +- return length; ++ handle_mid(mid, server, smb_buffer, length); ++ return 0; + } + + static int diff --git a/queue-3.2/cifs-request-oplock-when-doing-open-on-lookup.patch b/queue-3.2/cifs-request-oplock-when-doing-open-on-lookup.patch new file mode 100644 index 00000000000..e54313f077d --- /dev/null +++ b/queue-3.2/cifs-request-oplock-when-doing-open-on-lookup.patch @@ -0,0 +1,30 @@ +From 8b0192a5f478da1c1ae906bf3ffff53f26204f56 Mon Sep 17 00:00:00 2001 +From: Jeff Layton +Date: Tue, 7 Feb 2012 06:30:52 -0500 +Subject: cifs: request oplock when doing open on lookup + +From: Jeff Layton + +commit 8b0192a5f478da1c1ae906bf3ffff53f26204f56 upstream. + +Currently, it's always set to 0 (no oplock requested). + +Signed-off-by: Jeff Layton +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman + +--- + fs/cifs/dir.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/cifs/dir.c ++++ b/fs/cifs/dir.c +@@ -492,7 +492,7 @@ cifs_lookup(struct inode *parent_dir_ino + { + int xid; + int rc = 0; /* to get around spurious gcc warning, set to zero here */ +- __u32 oplock = 0; ++ __u32 oplock = enable_oplocks ? REQ_OPLOCK : 0; + __u16 fileHandle = 0; + bool posix_open = false; + struct cifs_sb_info *cifs_sb; diff --git a/queue-3.2/crypto-sha512-avoid-stack-bloat-on-i386.patch b/queue-3.2/crypto-sha512-avoid-stack-bloat-on-i386.patch new file mode 100644 index 00000000000..2b7b3935c8b --- /dev/null +++ b/queue-3.2/crypto-sha512-avoid-stack-bloat-on-i386.patch @@ -0,0 +1,111 @@ +From 3a92d687c8015860a19213e3c102cad6b722f83c Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Sun, 5 Feb 2012 15:09:28 +1100 +Subject: crypto: sha512 - Avoid stack bloat on i386 + +From: Herbert Xu + +commit 3a92d687c8015860a19213e3c102cad6b722f83c upstream. + +Unfortunately in reducing W from 80 to 16 we ended up unrolling +the loop twice. As gcc has issues dealing with 64-bit ops on +i386 this means that we end up using even more stack space (>1K). + +This patch solves the W reduction by moving LOAD_OP/BLEND_OP +into the loop itself, thus avoiding the need to duplicate it. + +While the stack space still isn't great (>0.5K) it is at least +in the same ball park as the amount of stack used for our C sha1 +implementation. + +Note that this patch basically reverts to the original code so +the diff looks bigger than it really is. + +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman + +--- + crypto/sha512_generic.c | 68 ++++++++++++++++++++++-------------------------- + 1 file changed, 32 insertions(+), 36 deletions(-) + +--- a/crypto/sha512_generic.c ++++ b/crypto/sha512_generic.c +@@ -89,46 +89,42 @@ sha512_transform(u64 *state, const u8 *i + int i; + u64 W[16]; + +- /* load the input */ +- for (i = 0; i < 16; i++) +- LOAD_OP(i, W, input); +- + /* load the state into our registers */ + a=state[0]; b=state[1]; c=state[2]; d=state[3]; + e=state[4]; f=state[5]; g=state[6]; h=state[7]; + +-#define SHA512_0_15(i, a, b, c, d, e, f, g, h) \ +- t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[i]; \ +- t2 = e0(a) + Maj(a, b, c); \ +- d += t1; \ +- h = t1 + t2 +- +-#define SHA512_16_79(i, a, b, c, d, e, f, g, h) \ +- BLEND_OP(i, W); \ +- t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[(i)&15]; \ +- t2 = e0(a) + Maj(a, b, c); \ +- d += t1; \ +- h = t1 + t2 +- +- for (i = 0; i < 16; i += 8) { +- SHA512_0_15(i, a, b, c, d, e, f, g, h); +- SHA512_0_15(i + 1, h, a, b, c, d, e, f, g); +- SHA512_0_15(i + 2, g, h, a, b, c, d, e, f); +- SHA512_0_15(i + 3, f, g, h, a, b, c, d, e); +- SHA512_0_15(i + 4, e, f, g, h, a, b, c, d); +- SHA512_0_15(i + 5, d, e, f, g, h, a, b, c); +- SHA512_0_15(i + 6, c, d, e, f, g, h, a, b); +- SHA512_0_15(i + 7, b, c, d, e, f, g, h, a); +- } +- for (i = 16; i < 80; i += 8) { +- SHA512_16_79(i, a, b, c, d, e, f, g, h); +- SHA512_16_79(i + 1, h, a, b, c, d, e, f, g); +- SHA512_16_79(i + 2, g, h, a, b, c, d, e, f); +- SHA512_16_79(i + 3, f, g, h, a, b, c, d, e); +- SHA512_16_79(i + 4, e, f, g, h, a, b, c, d); +- SHA512_16_79(i + 5, d, e, f, g, h, a, b, c); +- SHA512_16_79(i + 6, c, d, e, f, g, h, a, b); +- SHA512_16_79(i + 7, b, c, d, e, f, g, h, a); ++ /* now iterate */ ++ for (i=0; i<80; i+=8) { ++ if (!(i & 8)) { ++ int j; ++ ++ if (i < 16) { ++ /* load the input */ ++ for (j = 0; j < 16; j++) ++ LOAD_OP(i + j, W, input); ++ } else { ++ for (j = 0; j < 16; j++) { ++ BLEND_OP(i + j, W); ++ } ++ } ++ } ++ ++ t1 = h + e1(e) + Ch(e,f,g) + sha512_K[i ] + W[(i & 15)]; ++ t2 = e0(a) + Maj(a,b,c); d+=t1; h=t1+t2; ++ t1 = g + e1(d) + Ch(d,e,f) + sha512_K[i+1] + W[(i & 15) + 1]; ++ t2 = e0(h) + Maj(h,a,b); c+=t1; g=t1+t2; ++ t1 = f + e1(c) + Ch(c,d,e) + sha512_K[i+2] + W[(i & 15) + 2]; ++ t2 = e0(g) + Maj(g,h,a); b+=t1; f=t1+t2; ++ t1 = e + e1(b) + Ch(b,c,d) + sha512_K[i+3] + W[(i & 15) + 3]; ++ t2 = e0(f) + Maj(f,g,h); a+=t1; e=t1+t2; ++ t1 = d + e1(a) + Ch(a,b,c) + sha512_K[i+4] + W[(i & 15) + 4]; ++ t2 = e0(e) + Maj(e,f,g); h+=t1; d=t1+t2; ++ t1 = c + e1(h) + Ch(h,a,b) + sha512_K[i+5] + W[(i & 15) + 5]; ++ t2 = e0(d) + Maj(d,e,f); g+=t1; c=t1+t2; ++ t1 = b + e1(g) + Ch(g,h,a) + sha512_K[i+6] + W[(i & 15) + 6]; ++ t2 = e0(c) + Maj(c,d,e); f+=t1; b=t1+t2; ++ t1 = a + e1(f) + Ch(f,g,h) + sha512_K[i+7] + W[(i & 15) + 7]; ++ t2 = e0(b) + Maj(b,c,d); e+=t1; a=t1+t2; + } + + state[0] += a; state[1] += b; state[2] += c; state[3] += d; diff --git a/queue-3.2/crypto-sha512-use-binary-and-instead-of-modulus.patch b/queue-3.2/crypto-sha512-use-binary-and-instead-of-modulus.patch new file mode 100644 index 00000000000..2dba02da354 --- /dev/null +++ b/queue-3.2/crypto-sha512-use-binary-and-instead-of-modulus.patch @@ -0,0 +1,40 @@ +From 58d7d18b5268febb8b1391c6dffc8e2aaa751fcd Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Thu, 26 Jan 2012 15:03:16 +1100 +Subject: crypto: sha512 - Use binary and instead of modulus + +From: Herbert Xu + +commit 58d7d18b5268febb8b1391c6dffc8e2aaa751fcd upstream. + +The previous patch used the modulus operator over a power of 2 +unnecessarily which may produce suboptimal binary code. This +patch changes changes them to binary ands instead. + +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman + +--- + crypto/sha512_generic.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/crypto/sha512_generic.c ++++ b/crypto/sha512_generic.c +@@ -78,7 +78,7 @@ static inline void LOAD_OP(int I, u64 *W + + static inline void BLEND_OP(int I, u64 *W) + { +- W[I % 16] += s1(W[(I-2) % 16]) + W[(I-7) % 16] + s0(W[(I-15) % 16]); ++ W[I & 15] += s1(W[(I-2) & 15]) + W[(I-7) & 15] + s0(W[(I-15) & 15]); + } + + static void +@@ -105,7 +105,7 @@ sha512_transform(u64 *state, const u8 *i + + #define SHA512_16_79(i, a, b, c, d, e, f, g, h) \ + BLEND_OP(i, W); \ +- t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[(i)%16]; \ ++ t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[(i)&15]; \ + t2 = e0(a) + Maj(a, b, c); \ + d += t1; \ + h = t1 + t2 diff --git a/queue-3.2/series b/queue-3.2/series index 820e0bf4fdf..7d5484b2cf8 100644 --- a/queue-3.2/series +++ b/queue-3.2/series @@ -15,3 +15,7 @@ mac80211-timeout-a-single-frame-in-the-rx-reorder-buffer.patch writeback-fix-null-bdi-dev-in-trace-writeback_single_inode.patch writeback-fix-dereferencing-null-bdi-dev-on-trace_writeback_queue.patch hwmon-f75375s-fix-automatic-pwm-mode-setting-for-f75373-f75375.patch +cifs-request-oplock-when-doing-open-on-lookup.patch +cifs-don-t-return-error-from-standard_receive3-after.patch +crypto-sha512-use-binary-and-instead-of-modulus.patch +crypto-sha512-avoid-stack-bloat-on-i386.patch