]>
Commit | Line | Data |
---|---|---|
ba172962 SL |
1 | From 4782fdff5c29efe271b4a5194c4b90def1ca1332 Mon Sep 17 00:00:00 2001 |
2 | From: Namjae Jeon <linkinjeon@gmail.com> | |
3 | Date: Tue, 22 Jan 2019 09:46:45 +0900 | |
4 | Subject: cifs: Accept validate negotiate if server return | |
5 | NT_STATUS_NOT_SUPPORTED | |
6 | ||
7 | [ Upstream commit 969ae8e8d4ee54c99134d3895f2adf96047f5bee ] | |
8 | ||
9 | Old windows version or Netapp SMB server will return | |
10 | NT_STATUS_NOT_SUPPORTED since they do not allow or implement | |
11 | FSCTL_VALIDATE_NEGOTIATE_INFO. The client should accept the response | |
12 | provided it's properly signed. | |
13 | ||
14 | See | |
15 | https://blogs.msdn.microsoft.com/openspecification/2012/06/28/smb3-secure-dialect-negotiation/ | |
16 | ||
17 | and | |
18 | ||
19 | MS-SMB2 validate negotiate response processing: | |
20 | https://msdn.microsoft.com/en-us/library/hh880630.aspx | |
21 | ||
22 | Samba client had already handled it. | |
23 | https://bugzilla.samba.org/attachment.cgi?id=13285&action=edit | |
24 | ||
25 | Signed-off-by: Namjae Jeon <linkinjeon@gmail.com> | |
26 | Signed-off-by: Steve French <stfrench@microsoft.com> | |
27 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
28 | --- | |
29 | fs/cifs/smb2pdu.c | 10 ++++++++-- | |
30 | 1 file changed, 8 insertions(+), 2 deletions(-) | |
31 | ||
32 | diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c | |
33 | index 3d0db37d64ad..71f32d983384 100644 | |
34 | --- a/fs/cifs/smb2pdu.c | |
35 | +++ b/fs/cifs/smb2pdu.c | |
36 | @@ -881,8 +881,14 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon) | |
37 | rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID, | |
38 | FSCTL_VALIDATE_NEGOTIATE_INFO, true /* is_fsctl */, | |
39 | (char *)pneg_inbuf, inbuflen, (char **)&pneg_rsp, &rsplen); | |
40 | - | |
41 | - if (rc != 0) { | |
42 | + if (rc == -EOPNOTSUPP) { | |
43 | + /* | |
44 | + * Old Windows versions or Netapp SMB server can return | |
45 | + * not supported error. Client should accept it. | |
46 | + */ | |
47 | + cifs_dbg(VFS, "Server does not support validate negotiate\n"); | |
48 | + return 0; | |
49 | + } else if (rc != 0) { | |
50 | cifs_dbg(VFS, "validate protocol negotiate failed: %d\n", rc); | |
51 | rc = -EIO; | |
52 | goto out_free_inbuf; | |
53 | -- | |
54 | 2.19.1 | |
55 |