[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 09 Aug 2007 01:42:03 +0900
From: Tejun Heo <htejun@...il.com>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
CC: Greg KH <greg@...ah.com>, linux-kernel@...r.kernel.org,
satyam@...radead.org, cornelia.huck@...ibm.com,
stern@...land.harvard.edu,
Linux Containers <containers@...ts.osdl.org>, gregkh@...e.de
Subject: Re: [PATCH 20/25] sysfs: Rename Support multiple superblocks
Eric W. Biederman wrote:
>> /* Find the first parent which has valid dentry.
>> */
>> dentry = NULL;
>> cur = sd;
>> while (!(dentry = __sysfs_get_dentry(sb, cur))) {
>> if (cur->s_flags & SYSFS_FLAG_REMOVED) {
>> dentry = ERR_PTR(-ENOENT);
>> break;
>> }
>> cur = cur->s_parent;
>> }
>
> Here we depend on the fact that sysfs_root is pointed to
> by sb->s_root so we know it will always have a dentry.
Hmmm... dentry could be ERR_PTR(-ENOENT) here if the REMOVED flag test
succeeded, right?
>> /* from the found dentry, look up depth times */
>> while (dentry->d_fsdata != sd) {
And then dereferenced. The REMOVED test should never succeed there, so
we're probably in the clear but still the code looks a bit scary.
--
tejun
-
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