Bug 215440
Summary: | CIFS: DFS namespaces with non-ASCII symbols cannot be mounted | ||
---|---|---|---|
Product: | File System | Reporter: | Eugene Korenevsky (eugene) |
Component: | CIFS | Assignee: | fs_cifs (fs_cifs) |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | m.novosyolov |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 5.16.0-rc6+ | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: | proposed patch which solves mounting (but DOES NOT solve 'ls' at mounted DFS namespace) |
Description
Eugene Korenevsky
2021-12-29 20:38:49 UTC
Created attachment 300185 [details]
proposed patch which solves mounting (but DOES NOT solve 'ls' at mounted DFS namespace)
Attached patch (which avoids appending separator if the path is empty) solves mounting problem. But another problem arises. If we try to 'ls' mounted non-ASCII DFS namespace which contains DFS referrals, we get weird error: # ls /tmp/x ls: /tmp/x/dfs: No such file or directory If we compare Wireshark dumps of 'ls' at ASCII and non-ASCII DFS namespaces, we see the difference: 1. Latin-symbols-only DFS namespace, SMB2 CREATE => OK, returns STATUS_PATH_NOT_COVERED: 166 4.351764 192.168.57.16 192.168.57.14 SMB2 462 Create Request File: WIN-TCIN4O86A6M\dfsns\dfs;GetInfo Request FILE_INFO/SMB2_FILE_ALL_INFO;Close Request 167 4.371416 192.168.57.14 192.168.57.16 SMB2 310 Create Response, Error: STATUS_PATH_NOT_COVERED;GetInfo Response, Error: STATUS_PATH_NOT_COVERED;Close Response, Error: STATUS_PATH_NOT_COVERED 2. non-ASCII DFS namespace, SMB2 CREATE => FAIL, returns STATUS_OBJECT_NAME_INVALID: 171 4.788997 192.168.57.16 192.168.57.14 SMB2 462 Create Request File: WIN-TCIN4O86A6M\дфс\dfs;GetInfo Request FILE_INFO/SMB2_FILE_ALL_INFO;Close Request 172 4.789197 192.168.57.14 192.168.57.16 SMB2 310 Create Response, Error: STATUS_OBJECT_NAME_INVALID;GetInfo Response, Error: STATUS_OBJECT_NAME_INVALID;Close Response, Error: STATUS_OBJECT_NAME_INVALID For the last case, SMB2 CREATE request for DFS referral and non-ASCII DFS namespace returns STATUS_OBJECT_NAME_INVALID instead of STATUS_PATH_NOT_COVERED (which is totally unexpected by this code https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/cifs/connect.c?h=v5.16-rc7#n3574) and DFS referral submount fails. Returning STATUS_OBJECT_NAME_INVALID does not conform to MS-DFSC (see further). Inspected same workflow of Windows SMB client (listing non-ASCII DSF namespace). Windows SMB client uses different approach, opens DFS referrals in different way and avoids this problem. But Linux CIFS is affected and this is the problem. --------------- MS-DFSC 3.1.5.1 I/O Operation to Target Fails with STATUS_PATH_NOT_COVERED When an I/O operation that is issued to a link target fails with STATUS_PATH_NOT_COVERED (0xC0000257), the client MUST fail the original I/O request. When an I/O operation issued to a DFS root target server in step 8 of section 3.1.4.1 fails with STATUS_PATH_NOT_COVERED (0xC0000257), it indicates that the portion of the DFS namespace accessed by the client is not contained in the DFS root target server. SMB 1.0 ('vers=1.0' mount option) is not affected. Probably duplicate of https://bugzilla.kernel.org/show_bug.cgi?id=219083 , fixed by commit https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20241024&id=36bb22a08a69d9984a8399c07310d18b115eae20 *** This bug has been marked as a duplicate of bug 219083 *** |