]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
cifs: Accept validate negotiate if server return NT_STATUS_NOT_SUPPORTED
authorNamjae Jeon <linkinjeon@gmail.com>
Tue, 22 Jan 2019 00:46:45 +0000 (09:46 +0900)
committerSteve French <stfrench@microsoft.com>
Tue, 5 Mar 2019 02:06:38 +0000 (20:06 -0600)
Old windows version or Netapp SMB server will return
NT_STATUS_NOT_SUPPORTED since they do not allow or implement
FSCTL_VALIDATE_NEGOTIATE_INFO. The client should accept the response
provided it's properly signed.

See
https://blogs.msdn.microsoft.com/openspecification/2012/06/28/smb3-secure-dialect-negotiation/

and

MS-SMB2 validate negotiate response processing:
https://msdn.microsoft.com/en-us/library/hh880630.aspx

Samba client had already handled it.
https://bugzilla.samba.org/attachment.cgi?id=13285&action=edit

Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2pdu.c

index 3e9bee35a03cf96971cd2e9b5e6495727440b08a..f2980f78149c53a02c826fde3d5f5e8279c8bc97 100644 (file)
@@ -986,8 +986,14 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon)
        rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID,
                FSCTL_VALIDATE_NEGOTIATE_INFO, true /* is_fsctl */,
                (char *)pneg_inbuf, inbuflen, (char **)&pneg_rsp, &rsplen);
-
-       if (rc != 0) {
+       if (rc == -EOPNOTSUPP) {
+               /*
+                * Old Windows versions or Netapp SMB server can return
+                * not supported error. Client should accept it.
+                */
+               cifs_dbg(VFS, "Server does not support validate negotiate\n");
+               return 0;
+       } else if (rc != 0) {
                cifs_dbg(VFS, "validate protocol negotiate failed: %d\n", rc);
                rc = -EIO;
                goto out_free_inbuf;