diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-16 16:51:27 -0700 | 
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-16 16:51:27 -0700 | 
| commit | 8f949b9a7e0bac3a9c3c29dc27c476a87e21db3e (patch) | |
| tree | 88cd7852d59ebae54fcc2f57019ea13284042962 /fs/cifs/smb2misc.c | |
| parent | 6f586e663e3b3674cadad0d5329424b006a0a289 (diff) | |
| parent | 5698bd757d55b1bb87edd1a9744ab09c142abfc2 (diff) | |
| download | olio-linux-3.10-8f949b9a7e0bac3a9c3c29dc27c476a87e21db3e.tar.xz olio-linux-3.10-8f949b9a7e0bac3a9c3c29dc27c476a87e21db3e.zip  | |
Merge 3.6-rc7 into driver-core-next
This pulls in the fixes in that branch that are needed here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/cifs/smb2misc.c')
| -rw-r--r-- | fs/cifs/smb2misc.c | 16 | 
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c index a4ff5d54755..e4d3b996416 100644 --- a/fs/cifs/smb2misc.c +++ b/fs/cifs/smb2misc.c @@ -52,7 +52,8 @@ check_smb2_hdr(struct smb2_hdr *hdr, __u64 mid)  			cERROR(1, "Bad protocol string signature header %x",  				  *(unsigned int *) hdr->ProtocolId);  		if (mid != hdr->MessageId) -			cERROR(1, "Mids do not match"); +			cERROR(1, "Mids do not match: %llu and %llu", mid, +				  hdr->MessageId);  	}  	cERROR(1, "Bad SMB detected. The Mid=%llu", hdr->MessageId);  	return 1; @@ -107,7 +108,7 @@ smb2_check_message(char *buf, unsigned int length)  	 * ie Validate the wct via smb2_struct_sizes table above  	 */ -	if (length < 2 + sizeof(struct smb2_hdr)) { +	if (length < sizeof(struct smb2_pdu)) {  		if ((length >= sizeof(struct smb2_hdr)) && (hdr->Status != 0)) {  			pdu->StructureSize2 = 0;  			/* @@ -121,15 +122,15 @@ smb2_check_message(char *buf, unsigned int length)  		return 1;  	}  	if (len > CIFSMaxBufSize + MAX_SMB2_HDR_SIZE - 4) { -		cERROR(1, "SMB length greater than maximum, mid=%lld", mid); +		cERROR(1, "SMB length greater than maximum, mid=%llu", mid);  		return 1;  	}  	if (check_smb2_hdr(hdr, mid))  		return 1; -	if (hdr->StructureSize != SMB2_HEADER_SIZE) { -		cERROR(1, "Illegal structure size %d", +	if (hdr->StructureSize != SMB2_HEADER_STRUCTURE_SIZE) { +		cERROR(1, "Illegal structure size %u",  			  le16_to_cpu(hdr->StructureSize));  		return 1;  	} @@ -161,8 +162,9 @@ smb2_check_message(char *buf, unsigned int length)  	if (4 + len != clc_len) {  		cFYI(1, "Calculated size %u length %u mismatch mid %llu",  			clc_len, 4 + len, mid); -		if (clc_len == 4 + len + 1) /* BB FIXME (fix samba) */ -			return 0; /* BB workaround Samba 3 bug SessSetup rsp */ +		/* server can return one byte more */ +		if (clc_len == 4 + len + 1) +			return 0;  		return 1;  	}  	return 0;  |