]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
ksmbd: fix guest connection failure with nautilus
authorNamjae Jeon <linkinjeon@kernel.org>
Mon, 17 Jan 2022 13:16:01 +0000 (22:16 +0900)
committerPaolo Pisati <paolo.pisati@canonical.com>
Fri, 28 Jan 2022 09:58:56 +0000 (10:58 +0100)
commit690c561a3f8181431142490da4e262a6dc3ecfe6
tree6cc875f54f778079052c032bba8fecd6e279e2db
parent3de5fdfeb99d65a4f14c11ddb6effb3c250ee6fa
ksmbd: fix guest connection failure with nautilus

BugLink: https://bugs.launchpad.net/bugs/1959376
commit ac090d9c90b087d6fb714e54b2a6dd1e6c373ed6 upstream.

MS-SMB2 describe session sign like the following.
Session.SigningRequired MUST be set to TRUE under the following conditions:
 - If the SMB2_NEGOTIATE_SIGNING_REQUIRED bit is set in the SecurityMode
   field of the client request.
 - If the SMB2_SESSION_FLAG_IS_GUEST bit is not set in the SessionFlags
   field and Session.IsAnonymous is FALSE and either Connection.ShouldSign
   or global RequireMessageSigning is TRUE.

When trying guest account connection using nautilus, The login failure
happened on session setup. ksmbd does not allow this connection
when the user is a guest and the connection sign is set. Just do not set
session sign instead of error response as described in the specification.
And this change improves the guest connection in Nautilus.

Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org # v5.15+
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
fs/ksmbd/smb2pdu.c