Skip to content
Snippets Groups Projects
Commit 8602c3e2 authored by Marios Makassikis's avatar Marios Makassikis Committed by Namjae Jeon
Browse files

cifsd: Do not use 0 or 0xFFFFFFFF for TreeID


Returning TreeID=0 is valid behaviour according to [MS-SMB2] 2.2.1.2:

  TreeId (4 bytes): Uniquely identifies the tree connect for the command.
  This MUST be 0 for the SMB2 TREE_CONNECT Request. The TreeId can be
  any unsigned 32-bit integer that is received from a previous
  SMB2 TREE_CONNECT Response. TreeId SHOULD be set to 0 for the
  following commands:
   [...]

However, some client implementations reject it as invalid. Windows10
assigns ids starting from 1, and samba4 returns a random uint32_t
which suggests there may be other clients that consider it is
invalid behaviour.

Signed-off-by: default avatarMarios Makassikis <mmakassikis@freebox.fr>
Signed-off-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 50bf80a5
No related branches found
No related tags found
No related merge requests found
......@@ -14,9 +14,7 @@ int ksmbd_acquire_smb2_tid(struct ida *ida)
{
int id;
id = __acquire_id(ida, 0, 0);
if (id == 0xFFFF)
id = __acquire_id(ida, 0, 0);
id = __acquire_id(ida, 1, 0xFFFFFFFF);
return id;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment