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-prev] [day] [month] [year] [list]
Message-Id: <1277925145-8355-2-git-send-email-johnstul@us.ibm.com>
Date:	Wed, 30 Jun 2010 12:12:25 -0700
From:	John Stultz <johnstul@...ibm.com>
To:	linux-kernel@...r.kernel.org
Cc:	John Stultz <johnstul@...ibm.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Nick Piggin <npiggin@...e.de>,
	Peter Zijlstra <peterz@...radead.org>,
	John Kacur <jkacur@...hat.com>
Subject: [PATCH -rt 2/2] Make sure d_kill sets d_parent to null

Patch against currrent 2.6.33-rt tree.

This patch is an alternative fix to the select_parent panic that was
suggested by Nick Piggin.

It resolves the issue by making sure d_parent is set to null so that
the dentry ascending code in select_parent will restart if the child
or next dentry was dkilled while the locks were released.

Credit and thanks to Nick for finding the solution.

Signed-off-by: John Stultz <johnstul@...ibm.com>
CC: Thomas Gleixner <tglx@...utronix.de>
CC: Nick Piggin <npiggin@...e.de>
CC: Peter Zijlstra <peterz@...radead.org>
CC: John Kacur <jkacur@...hat.com>
---
 fs/dcache.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index da90157..c9d21ae 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -225,13 +225,15 @@ static struct dentry *d_kill(struct dentry *dentry)
 {
 	struct dentry *parent;
 
-	list_del(&dentry->d_u.d_child);
-	if (dentry->d_parent && dentry != dentry->d_parent)
-		spin_unlock(&dentry->d_parent->d_lock);
 	if (IS_ROOT(dentry))
 		parent = NULL;
 	else
 		parent = dentry->d_parent;
+
+	dentry->d_parent = NULL;
+	list_del(&dentry->d_u.d_child);
+	if (parent)
+		spin_unlock(&parent->d_lock);
 	/*drops the locks, at that point nobody can reach this dentry */
 	dentry_iput(dentry);
 	d_free(dentry);
-- 
1.6.0.4

--
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