aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/misc.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 988b8cec8568..5d2fd70b50f8 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -429,7 +429,8 @@ checkSMB(struct smb_hdr *smb, __u16 mid, int length)
429 sizeof (struct smb_hdr) - 1) 429 sizeof (struct smb_hdr) - 1)
430 && (smb->Status.CifsError != 0)) { 430 && (smb->Status.CifsError != 0)) {
431 smb->WordCount = 0; 431 smb->WordCount = 0;
432 return 0; /* some error cases do not return wct and bcc */ 432 /* some error cases do not return wct and bcc */
433 return 0;
433 } else { 434 } else {
434 cERROR(1, ("Length less than smb header size")); 435 cERROR(1, ("Length less than smb header size"));
435 } 436 }
@@ -456,9 +457,8 @@ checkSMB(struct smb_hdr *smb, __u16 mid, int length)
456 if(((4 + len) & 0xFFFF) == (clc_len & 0xFFFF)) 457 if(((4 + len) & 0xFFFF) == (clc_len & 0xFFFF))
457 return 0; /* bcc wrapped */ 458 return 0; /* bcc wrapped */
458 } 459 }
459 cERROR(1, ("Calculated size 0x%x vs actual length 0x%x", 460 cFYI(1, ("Calculated size %d vs length %d mismatch for mid %d",
460 clc_len, 4 + len)); 461 clc_len, 4 + len, smb->Mid));
461 cERROR(1, ("bad smb size detected for Mid=%d", smb->Mid));
462 /* Windows XP can return a few bytes too much, presumably 462 /* Windows XP can return a few bytes too much, presumably
463 an illegal pad, at the end of byte range lock responses 463 an illegal pad, at the end of byte range lock responses
464 so we allow for that three byte pad, as long as actual 464 so we allow for that three byte pad, as long as actual
@@ -472,8 +472,11 @@ checkSMB(struct smb_hdr *smb, __u16 mid, int length)
472 wct and bcc to minimum size and drop the t2 parms and data */ 472 wct and bcc to minimum size and drop the t2 parms and data */
473 if((4+len > clc_len) && (len <= clc_len + 512)) 473 if((4+len > clc_len) && (len <= clc_len + 512))
474 return 0; 474 return 0;
475 else 475 else {
476 cERROR(1, ("RFC1001 size %d bigger than SMB for Mid=%d",
477 len, smb->Mid));
476 return 1; 478 return 1;
479 }
477 } 480 }
478 return 0; 481 return 0;
479} 482}