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

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

From: Al Viro <viro@zeniv.linux.org.uk>
Date: 2021-03-24 15:29:25
Also in: linux-fsdevel
Subsystem: filesystems (vfs and infrastructure), the rest · Maintainers: Alexander Viro, Christian Brauner, Linus Torvalds

On Tue, Mar 23, 2021 at 12:04:34AM -0500, Steve French wrote:
reran with the updated patch 7 and it failed (although I didn't have
time to dig much into it today) - see

http://smb3-test-rhel-75.southcentralus.cloudapp.azure.com/#/builders/2/builds/534

but it seems to run ok without patch 7 (just the first six patches)

http://smb3-test-rhel-75.southcentralus.cloudapp.azure.com/#/builders/2/builds/535
Hmm...  Another bug, AFAICS, is that for root we end up with "/", not "".
No idea if that's all there is, though ;-/  How does one set the things up
for those tests?  Anyway, incremental would be
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index ed16f75ac0fa..03afad8b24af 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -114,6 +114,8 @@ build_path_from_dentry_optional_prefix(struct dentry *direntry, void *page,
 	s = dentry_path_raw(direntry, page, PAGE_SIZE);
 	if (IS_ERR(s))
 		return s;
+	if (!s[1])	// for root we want "", not "/"
+		s++;
 	if (s < (char *)page + pplen + dfsplen)
 		return ERR_PTR(-ENAMETOOLONG);
 	if (pplen) {
Folded and force-pushed.  Could you throw the updated branch into testing?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help