[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <11876133893733-git-send-email-htejun@gmail.com>
Date: Mon, 20 Aug 2007 21:36:29 +0900
From: Tejun Heo <htejun@...il.com>
To: ebiederm@...ssion.com, cornelia.huck@...ibm.com, greg@...ah.com,
linux-kernel@...r.kernel.org, satyam@...radead.org,
stern@...land.harvard.edu, containers@...ts.osdl.org,
htejun@...il.com
Cc: Tejun Heo <htejun@...il.com>
Subject: [PATCH 01/14] sysfs: fix i_mutex locking in sysfs_get_dentry()
lookup_one_len_kern() should be called with the parent's i_mutex
locked. Fix it.
Spotted by Eric W. Biederman.
Signed-off-by: Tejun Heo <htejun@...il.com>
Cc: Eric W. Biederman <ebiederm@...ssion.com>
---
fs/sysfs/dir.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index e4fd8a2..b33af5e 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -130,8 +130,10 @@ struct dentry *sysfs_get_dentry(struct sysfs_dirent *sd)
/* look it up */
parent_dentry = dentry;
+ mutex_lock(&parent_dentry->d_inode->i_mutex);
dentry = lookup_one_len_kern(cur->s_name, parent_dentry,
strlen(cur->s_name));
+ mutex_unlock(&parent_dentry->d_inode->i_mutex);
dput(parent_dentry);
if (IS_ERR(dentry)) {
--
1.5.0.3
-
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