Skip to contentSkip to conversation

Reset TreeId to zero on SMB2 TREE_CONNECT

PATCH In review Jan-Marek Glogowski 2 participants 3 messages Feb 20, 2017 – Mar 24, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Reset TreeId to zero on SMB2 TREE_CONNECT

Currently the cifs module breaks the CIFS specs on reconnect as described in http://msdn.microsoft.com/en-us/library/cc246529.aspx:

"TreeId (4 bytes): Uniquely identifies the tree connect for the command. This MUST be 0 for the SMB2 TREE_CONNECT Request."

---
 fs/cifs/smb2pdu.c | 4 ++++
 1 file changed, 4 insertions(+)
fs/cifs/smb2pdu.c +4 -0
index 8745722..bdd3292 100644
@@ -1104,6 +1104,10 @@ static inline void init_copy_chunk_defaults(struct cifs_tcon *tcon)
 		return -EINVAL;
 	}
 
+	/* SMB2 TREE_CONNECT request must be called with TreeId == 0 */
+	if (tcon)
+		tcon->tid = 0;
+
 	rc = small_smb2_init(SMB2_TREE_CONNECT, tcon, (void **) &req);
 	if (rc) {
 		kfree(unc_path);
Signature · 1 line
1.9.1

A message that is not in the archive (sent off-list or not yet received): 1487589958-20489-1-git-send-email-glogow-iG8UcmBuX++ELgA04lAiVw@public.gmane.org

#2 lore raw

Hi everyone,

just replying to my own patch mail.

The patch is now pending for a month. I saw other stuff picked up for linux-next and wondered, if it was missing something?

The patch was developed with the help of Aurelien Aptel, originally in the "Fix SMB2_TREE_CONNECT requests with the wrong TreeId" thread starting 2017-02-10.

There is a bug report with an attached trace and my debug scripts at
https://bugzilla.samba.org/show_bug.cgi?id=12584

Best regards,

Jan-Marek Glogowski

A message that is not in the archive (sent off-list or not yet received): efd254dc-ecd6-5ea7-7850-b287c64071c2-iG8UcmBuX++ELgA04lAiVw@public.gmane.org

#4 lore raw

I plan to merge this

Quoted 21 lines · Jan-Marek Glogowski

Hi everyone,

just replying to my own patch mail.

The patch is now pending for a month. I saw other stuff picked up for linux-next and wondered, if it was missing something?

The patch was developed with the help of Aurelien Aptel, originally in the "Fix SMB2_TREE_CONNECT requests with the wrong TreeId" thread starting 2017-02-10.

There is a bug report with an attached trace and my debug scripts at
https://bugzilla.samba.org/show_bug.cgi?id=12584

Best regards,

Jan-Marek Glogowski
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 3 lines
Thanks,

Steve