diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-02-07 06:31:05 -0500 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-02-07 23:25:31 -0500 |
commit | ff4fa4a25a33f92b5653bb43add0c63bea98d464 (patch) | |
tree | cdd46e53bc579250fc0722b2d2f11ff183b47715 /fs | |
parent | 8b0192a5f478da1c1ae906bf3ffff53f26204f56 (diff) |
cifs: don't return error from standard_receive3 after marking response malformed
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.
Cc: stable@vger.kernel.org
Reported-and-Tested-by: Mark Moseley <moseleymark@gmail.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/connect.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 940189bd6490..602f77c304c9 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -773,10 +773,11 @@ standard_receive3(struct TCP_Server_Info *server, struct mid_q_entry *mid) | |||
773 | cifs_dump_mem("Bad SMB: ", buf, | 773 | cifs_dump_mem("Bad SMB: ", buf, |
774 | min_t(unsigned int, server->total_read, 48)); | 774 | min_t(unsigned int, server->total_read, 48)); |
775 | 775 | ||
776 | if (mid) | 776 | if (!mid) |
777 | handle_mid(mid, server, smb_buffer, length); | 777 | return length; |
778 | 778 | ||
779 | return length; | 779 | handle_mid(mid, server, smb_buffer, length); |
780 | return 0; | ||
780 | } | 781 | } |
781 | 782 | ||
782 | static int | 783 | static int |