Skip to content

Commit 5ed11af

Browse files
namjaejeonsmfrench
authored andcommitted
ksmbd: do not set SMB2_GLOBAL_CAP_ENCRYPTION for SMB 3.1.1
SMB2_GLOBAL_CAP_ENCRYPTION flag should be used only for 3.0 and 3.0.2 dialects. This flags set cause compatibility problems with other SMB clients. Reported-by: James Christopher Adduono <[email protected]> Tested-by: James Christopher Adduono <[email protected]> Cc: [email protected] Signed-off-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent a677ebd commit 5ed11af

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

fs/smb/server/smb2ops.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ void init_smb3_0_server(struct ksmbd_conn *conn)
228228
conn->cli_cap & SMB2_GLOBAL_CAP_ENCRYPTION)
229229
conn->vals->capabilities |= SMB2_GLOBAL_CAP_ENCRYPTION;
230230

231+
if (server_conf.flags & KSMBD_GLOBAL_FLAG_SMB2_ENCRYPTION ||
232+
(!(server_conf.flags & KSMBD_GLOBAL_FLAG_SMB2_ENCRYPTION_OFF) &&
233+
conn->cli_cap & SMB2_GLOBAL_CAP_ENCRYPTION))
234+
conn->vals->capabilities |= SMB2_GLOBAL_CAP_ENCRYPTION;
235+
231236
if (server_conf.flags & KSMBD_GLOBAL_FLAG_SMB3_MULTICHANNEL)
232237
conn->vals->capabilities |= SMB2_GLOBAL_CAP_MULTI_CHANNEL;
233238
}
@@ -278,11 +283,6 @@ int init_smb3_11_server(struct ksmbd_conn *conn)
278283
conn->vals->capabilities |= SMB2_GLOBAL_CAP_LEASING |
279284
SMB2_GLOBAL_CAP_DIRECTORY_LEASING;
280285

281-
if (server_conf.flags & KSMBD_GLOBAL_FLAG_SMB2_ENCRYPTION ||
282-
(!(server_conf.flags & KSMBD_GLOBAL_FLAG_SMB2_ENCRYPTION_OFF) &&
283-
conn->cli_cap & SMB2_GLOBAL_CAP_ENCRYPTION))
284-
conn->vals->capabilities |= SMB2_GLOBAL_CAP_ENCRYPTION;
285-
286286
if (server_conf.flags & KSMBD_GLOBAL_FLAG_SMB3_MULTICHANNEL)
287287
conn->vals->capabilities |= SMB2_GLOBAL_CAP_MULTI_CHANNEL;
288288

0 commit comments

Comments
 (0)