Skip to content

Commit 8d9cbf8

Browse files
committed
Merge git://git.samba.org/sfrench/cifs-2.6
* git://git.samba.org/sfrench/cifs-2.6: [CIFS] default ntlmv2 for cifs mount delayed to 3.3 cifs: fix bad buffer length check in coalesce_t2
2 parents f423fc6 + 225de11 commit 8d9cbf8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/cifs/connect.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ static int coalesce_t2(struct smb_hdr *psecond, struct smb_hdr *pTargetSMB)
282282
byte_count = be32_to_cpu(pTargetSMB->smb_buf_length);
283283
byte_count += total_in_buf2;
284284
/* don't allow buffer to overflow */
285-
if (byte_count > CIFSMaxBufSize)
285+
if (byte_count > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4)
286286
return -ENOBUFS;
287287
pTargetSMB->smb_buf_length = cpu_to_be32(byte_count);
288288

@@ -2122,7 +2122,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
21222122
warned_on_ntlm = true;
21232123
cERROR(1, "default security mechanism requested. The default "
21242124
"security mechanism will be upgraded from ntlm to "
2125-
"ntlmv2 in kernel release 3.2");
2125+
"ntlmv2 in kernel release 3.3");
21262126
}
21272127
ses->overrideSecFlg = volume_info->secFlg;
21282128

0 commit comments

Comments
 (0)