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] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090127154437.9e7118f7.akpm@linux-foundation.org>
Date:	Tue, 27 Jan 2009 15:44:37 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Tejun Heo <tj@...nel.org>
Cc:	ebiederm@...ssion.com, gregkh@...e.de,
	linux-kernel@...r.kernel.org, viro@...IV.linux.org.uk,
	cornelia.huck@...ibm.com
Subject: Re: [PATCH] sysfs: Reference sysfs_dirent from sysfs inodes.

On Fri, 23 Jan 2009 15:33:48 +0900
Tejun Heo <tj@...nel.org> wrote:

> Eric W. Biederman wrote:
> > The sysfs_dirent serves as both an inode and a directory entry
> > for sysfs.  To prevent the sysfs inode numbers from being freed
> > prematurely hold a reference to sysfs_dirent from the sysfs inode.
> > 
> > Signed-off-by: Eric W. Biederman <ebiederm@...stanetworks.com>
> 
> Thanks for working on this.  Can you please add a comment explaining
> it on top of sysfs_delete_inode()?

Like this?

--- a/fs/sysfs/inode.c~sysfs-reference-sysfs_dirent-from-sysfs-inodes-fix
+++ a/fs/sysfs/inode.c
@@ -215,6 +215,13 @@ struct inode * sysfs_get_inode(struct sy
 	return inode;
 }
 
+/*
+ * The sysfs_dirent serves as both an inode and a directory entry for sysfs.
+ * To prevent the sysfs inode numbers from being freed prematurely we take a
+ * reference to sysfs_dirent from the sysfs inode.  A
+ * super_operations.delete_inode() implementation is needed to drop that
+ * reference upon inode destruction.
+ */
 void sysfs_delete_inode(struct inode *inode)
 {
 	struct sysfs_dirent *sd  = inode->i_private;
_

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