Thread (17 messages) 17 messages, 4 authors, 2021-03-24

Re: [RFC][PATCHSET] hopefully saner handling of pathnames in cifs

From: Steve French <smfrench@gmail.com>
Date: 2021-03-22 03:39:14
Also in: linux-fsdevel

Some additional context - currently because of the way cifs.ko handles
conversion of '/' we can't handle a filename with '\' in the filename
(although the protocol would support that via remapping into the UCS-2
remap range if we made a change to move slash conversion later).

On Sun, Mar 21, 2021 at 10:36 PM Steve French [off-list ref] wrote:
FYI - on a loosely related point  about / to \ conversion, I had been
experimenting with moving the conversion of '/' to '\' later depending
on connection type (see attached WIP patch for example).


On Sun, Mar 21, 2021 at 9:40 PM Al Viro [off-list ref] wrote:
quoted
On Sun, Mar 21, 2021 at 09:19:53PM -0500, Steve French wrote:
quoted
automated tests failed so will need to dig in a little more and see
what is going on

http://smb3-test-rhel-75.southcentralus.cloudapp.azure.com/#/builders/2/builds/533
<looks>

Oh, bugger...  I think I see a braino that might be responsible for that;
whether it's all that's going on or not, that's an obvious bug.  Incremental
for that one would be
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 3febf667d119..ed16f75ac0fa 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -132,7 +132,7 @@ build_path_from_dentry_optional_prefix(struct dentry *direntry, void *page,
        }
        if (dfsplen) {
                s -= dfsplen;
-               memcpy(page, tcon->treeName, dfsplen);
+               memcpy(s, tcon->treeName, dfsplen);
                if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) {
                        int i;
                        for (i = 0; i < dfsplen; i++) {

Folded and force-pushed (same branch).  My apologies...


--
Thanks,

Steve


-- 
Thanks,

Steve
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help