Skip to content

Commit aee0314

Browse files
committed
Merge tag '5.7-rc-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6
Pull cifs fixes from Steve French: "Three small smb3 fixes: two debug related (helping network tracing for SMB2 mounts, and the other removing an unintended debug line on signing failures), and one fixing a performance problem with 64K pages" * tag '5.7-rc-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: smb3: remove overly noisy debug line in signing errors cifs: improve read performance for page size 64KB & cache=strict & vers=2.1+ cifs: dump the session id and keys also for SMB2 sessions
2 parents 1340283 + 9692ea9 commit aee0314

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

fs/cifs/cifssmb.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,8 @@ decode_lanman_negprot_rsp(struct TCP_Server_Info *server, NEGOTIATE_RSP *pSMBr)
594594
cifs_max_pending);
595595
set_credits(server, server->maxReq);
596596
server->maxBuf = le16_to_cpu(rsp->MaxBufSize);
597+
/* set up max_read for readpages check */
598+
server->max_read = server->maxBuf;
597599
/* even though we do not use raw we might as well set this
598600
accurately, in case we ever find a need for it */
599601
if ((le16_to_cpu(rsp->RawMode) & RAW_ENABLE) == RAW_ENABLE) {
@@ -755,6 +757,8 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
755757
set_credits(server, server->maxReq);
756758
/* probably no need to store and check maxvcs */
757759
server->maxBuf = le32_to_cpu(pSMBr->MaxBufferSize);
760+
/* set up max_read for readpages check */
761+
server->max_read = server->maxBuf;
758762
server->max_rw = le32_to_cpu(pSMBr->MaxRawSize);
759763
cifs_dbg(NOISY, "Max buf = %d\n", ses->server->maxBuf);
760764
server->capabilities = le32_to_cpu(pSMBr->Capabilities);

fs/cifs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static void cifs_set_ops(struct inode *inode)
6161
}
6262

6363
/* check if server can support readpages */
64-
if (cifs_sb_master_tcon(cifs_sb)->ses->server->maxBuf <
64+
if (cifs_sb_master_tcon(cifs_sb)->ses->server->max_read <
6565
PAGE_SIZE + MAX_CIFS_HDR_SIZE)
6666
inode->i_data.a_ops = &cifs_addr_ops_smallbuf;
6767
else

fs/cifs/smb2pdu.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,6 +1552,21 @@ SMB2_sess_auth_rawntlmssp_authenticate(struct SMB2_sess_data *sess_data)
15521552
}
15531553

15541554
rc = SMB2_sess_establish_session(sess_data);
1555+
#ifdef CONFIG_CIFS_DEBUG_DUMP_KEYS
1556+
if (ses->server->dialect < SMB30_PROT_ID) {
1557+
cifs_dbg(VFS, "%s: dumping generated SMB2 session keys\n", __func__);
1558+
/*
1559+
* The session id is opaque in terms of endianness, so we can't
1560+
* print it as a long long. we dump it as we got it on the wire
1561+
*/
1562+
cifs_dbg(VFS, "Session Id %*ph\n", (int)sizeof(ses->Suid),
1563+
&ses->Suid);
1564+
cifs_dbg(VFS, "Session Key %*ph\n",
1565+
SMB2_NTLMV2_SESSKEY_SIZE, ses->auth_key.response);
1566+
cifs_dbg(VFS, "Signing Key %*ph\n",
1567+
SMB3_SIGN_KEY_SIZE, ses->auth_key.response);
1568+
}
1569+
#endif
15551570
out:
15561571
kfree(ntlmssp_blob);
15571572
SMB2_sess_free_buffer(sess_data);

fs/cifs/smb2transport.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,8 +660,8 @@ smb2_verify_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
660660
return rc;
661661

662662
if (memcmp(server_response_sig, shdr->Signature, SMB2_SIGNATURE_SIZE)) {
663-
dump_stack();
664-
cifs_dbg(VFS, "sign fail cmd 0x%x message id 0x%llx\n", shdr->Command, shdr->MessageId);
663+
cifs_dbg(VFS, "sign fail cmd 0x%x message id 0x%llx\n",
664+
shdr->Command, shdr->MessageId);
665665
return -EACCES;
666666
} else
667667
return 0;

0 commit comments

Comments
 (0)