Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121486
b: refs/heads/master
c: 6d9c6d5
h: refs/heads/master
v: v3
  • Loading branch information
Volker Lendecke authored and Steve French committed Dec 26, 2008
1 parent 7775d78 commit 83004d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 00e485b0198ea4f509341373f1d9adb0a5977a2f
refs/heads/master: 6d9c6d543165d1d492602c1371cb019040093584
31 changes: 12 additions & 19 deletions trunk/fs/cifs/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,12 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
to the same server. We may make this configurable later or
use ses->maxReq */

if (in_buf->smb_buf_length > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) {
cERROR(1, ("Illegal length, greater than maximum frame, %d",
in_buf->smb_buf_length));
return -EIO;
}

rc = wait_for_free_request(ses, long_op);
if (rc)
return rc;
Expand All @@ -706,17 +712,6 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
return rc;
}

if (in_buf->smb_buf_length > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) {
cERROR(1, ("Illegal length, greater than maximum frame, %d",
in_buf->smb_buf_length));
DeleteMidQEntry(midQ);
mutex_unlock(&ses->server->srv_mutex);
/* Update # of requests on wire to server */
atomic_dec(&ses->server->inFlight);
wake_up(&ses->server->request_q);
return -EIO;
}

rc = cifs_sign_smb(in_buf, ses->server, &midQ->sequence_number);

midQ->midState = MID_REQUEST_SUBMITTED;
Expand Down Expand Up @@ -925,6 +920,12 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
to the same server. We may make this configurable later or
use ses->maxReq */

if (in_buf->smb_buf_length > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) {
cERROR(1, ("Illegal length, greater than maximum frame, %d",
in_buf->smb_buf_length));
return -EIO;
}

rc = wait_for_free_request(ses, CIFS_BLOCKING_OP);
if (rc)
return rc;
Expand All @@ -941,14 +942,6 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
return rc;
}

if (in_buf->smb_buf_length > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) {
mutex_unlock(&ses->server->srv_mutex);
cERROR(1, ("Illegal length, greater than maximum frame, %d",
in_buf->smb_buf_length));
DeleteMidQEntry(midQ);
return -EIO;
}

rc = cifs_sign_smb(in_buf, ses->server, &midQ->sequence_number);

midQ->midState = MID_REQUEST_SUBMITTED;
Expand Down

0 comments on commit 83004d0

Please sign in to comment.