aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2011-04-29 06:52:44 -0400
committerSteve French <sfrench@us.ibm.com>2011-05-02 23:42:15 -0400
commit16541ba11c4f04ffe94b073e301f00b749fb84a1 (patch)
tree3ff03fa9202ba3bbe4aee3d036cddd6f0dbaceba /fs/cifs
parent146f9f65bd13f56665205aed7205d531c810cb35 (diff)
cifs: handle errors from coalesce_t2
cifs_demultiplex_thread calls coalesce_t2 to try and merge follow-on t2 responses into the original mid buffer. coalesce_t2 however can return errors, but the caller doesn't handle that situation properly. Fix the thread to treat such a case as it would a malformed packet. Mark the mid as being malformed and issue the callback. Cc: stable@kernel.org Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/connect.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index bfbf3235a69b..05f1dcf7d79a 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -630,12 +630,16 @@ incomplete_rcv:
630 isMultiRsp = true; 630 isMultiRsp = true;
631 if (mid_entry->resp_buf) { 631 if (mid_entry->resp_buf) {
632 /* merge response - fix up 1st*/ 632 /* merge response - fix up 1st*/
633 if (coalesce_t2(smb_buffer, 633 length = coalesce_t2(smb_buffer,
634 mid_entry->resp_buf)) { 634 mid_entry->resp_buf);
635 if (length > 0) {
636 length = 0;
635 mid_entry->multiRsp = true; 637 mid_entry->multiRsp = true;
636 break; 638 break;
637 } else { 639 } else {
638 /* all parts received */ 640 /* all parts received or
641 * packet is malformed
642 */
639 mid_entry->multiEnd = true; 643 mid_entry->multiEnd = true;
640 goto multi_t2_fnd; 644 goto multi_t2_fnd;
641 } 645 }