Commit 969ae8e8 authored by Namjae Jeon's avatar Namjae Jeon Committed by Steve French

cifs: Accept validate negotiate if server return NT_STATUS_NOT_SUPPORTED

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=editSigned-off-by: default avatarNamjae Jeon <linkinjeon@gmail.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent c781af7e
...@@ -986,8 +986,14 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon) ...@@ -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, rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID,
FSCTL_VALIDATE_NEGOTIATE_INFO, true /* is_fsctl */, FSCTL_VALIDATE_NEGOTIATE_INFO, true /* is_fsctl */,
(char *)pneg_inbuf, inbuflen, (char **)&pneg_rsp, &rsplen); (char *)pneg_inbuf, inbuflen, (char **)&pneg_rsp, &rsplen);
if (rc == -EOPNOTSUPP) {
if (rc != 0) { /*
* 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); cifs_dbg(VFS, "validate protocol negotiate failed: %d\n", rc);
rc = -EIO; rc = -EIO;
goto out_free_inbuf; goto out_free_inbuf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment