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>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 24 Sep 2012 19:45:39 +0200
From:	Maarten Lankhorst <maarten.lankhorst@...onical.com>
To:	al viro <viro@...iv.linux.org.uk>, linux-fsdevel@...r.kernel.org
CC:	LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] Revert "__d_unalias() should refuse to move mountpoints"

This reverts commit ee3efa91e240f513898050ef305a49a653c8ed90.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@...onical.com>

My thread about the regression seemed to have been ignored, so I can only
conclude nobody objects against a full revert of this patch.

My testcase is simply booting through netboot with / and ~/nfs as separate
nfs filesystems, then doing 'ls ~/nfs' followed by 'ls ~' in a gnome-terminal
window, then I get:

ls: cannot access nfs: Device or resource busy

Similar things seem to happen with ls /, /dev /proc and /sys will no longer work.

Reverting this patch seems to make things work again.

---

diff --git a/fs/dcache.c b/fs/dcache.c
index 16521a9..711f421 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2387,13 +2387,14 @@ static struct dentry *__d_unalias(struct inode *inode,
 		struct dentry *dentry, struct dentry *alias)
 {
 	struct mutex *m1 = NULL, *m2 = NULL;
-	struct dentry *ret = ERR_PTR(-EBUSY);
+	struct dentry *ret;
 
 	/* If alias and dentry share a parent, then no extra locks required */
 	if (alias->d_parent == dentry->d_parent)
 		goto out_unalias;
 
 	/* See lock_rename() */
+	ret = ERR_PTR(-EBUSY);
 	if (!mutex_trylock(&dentry->d_sb->s_vfs_rename_mutex))
 		goto out_err;
 	m1 = &dentry->d_sb->s_vfs_rename_mutex;
@@ -2401,10 +2402,8 @@ static struct dentry *__d_unalias(struct inode *inode,
 		goto out_err;
 	m2 = &alias->d_parent->d_inode->i_mutex;
 out_unalias:
-	if (likely(!d_mountpoint(alias))) {
-		__d_move(alias, dentry);
-		ret = alias;
-	}
+	__d_move(alias, dentry);
+	ret = alias;
 out_err:
 	spin_unlock(&inode->i_lock);
 	if (m2)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ