lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Thu, 9 Aug 2012 11:57:06 +1000
From:	NeilBrown <neilb@...e.de>
To:	Al Viro <viro@...iv.linux.org.uk>,
	"Myklebust, Trond" <Trond.Myklebust@...app.com>
Cc:	NFS <linux-nfs@...r.kernel.org>,
	lkml <linux-kernel@...r.kernel.org>
Subject: [PATCH] VFS: d_obtain_alias needs to use "/" as default name.


NFS appears to use d_obtain_alias() to create the root dentry rather
than d_make_root.  This can cause 'prepend_path()' to complain that the
root has a weird name if an NFS filesystem is lazily unmounted.
e.g. if "/mnt" is an NFS mount then

 { cd /mnt; umount -l /mnt ; ls -l /proc/self/cwd; }

will cause a WARN message like
   WARNING: at /home/git/linux/fs/dcache.c:2624 prepend_path+0x1d7/0x1e0()
   ...
   Root dentry has weird name <>

to appear in kernel logs.

So change d_obtain_alias() to use "/" rather than "" as the anonymous
name.

Signed-off-by: NeilBrown <neilb@...e.de>

diff --git a/fs/dcache.c b/fs/dcache.c
index 8086636..c959e41 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1579,7 +1579,7 @@ EXPORT_SYMBOL(d_find_any_alias);
  */
 struct dentry *d_obtain_alias(struct inode *inode)
 {
-	static const struct qstr anonstring = { .name = "" };
+	static const struct qstr anonstring = QSTR_INIT("/", 1);
 	struct dentry *tmp;
 	struct dentry *res;
 

Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ