Revision 112fc894a7c49e6435f91faa1cebfd425e6f3ace authored by David Howells on 27 January 2015, 15:18:39 UTC, committed by Al Viro on 20 February 2015, 09:56:43 UTC
Code that does this:

		if (!(d_unhashed(dentry) && dentry->d_inode)) {
			...
			simple_unlink(parent->d_inode, dentry);
		}

is broken because:

    !(d_unhashed(dentry) && dentry->d_inode)

is equivalent to:

    !d_unhashed(dentry) || !dentry->d_inode

so it is possible to get into simple_unlink() with dentry->d_inode == NULL.

simple_unlink(), however, assumes dentry->d_inode cannot be NULL.

I think that what was meant is this:

    !d_unhashed(dentry) && dentry->d_inode

and that the logical-not operator or the final close-bracket was misplaced.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent a457ac2
History
File Mode Size
.gitignore -rw-r--r-- 25 bytes
Kconfig -rw-r--r-- 2.8 KB
Makefile -rw-r--r-- 2.1 KB
audit.c -rw-r--r-- 12.4 KB
common.c -rw-r--r-- 75.1 KB
common.h -rw-r--r-- 40.1 KB
condition.c -rw-r--r-- 27.1 KB
domain.c -rw-r--r-- 24.7 KB
environ.c -rw-r--r-- 3.0 KB
file.c -rw-r--r-- 28.9 KB
gc.c -rw-r--r-- 16.7 KB
group.c -rw-r--r-- 5.6 KB
load_policy.c -rw-r--r-- 2.6 KB
memory.c -rw-r--r-- 5.4 KB
mount.c -rw-r--r-- 6.7 KB
network.c -rw-r--r-- 21.3 KB
realpath.c -rw-r--r-- 7.9 KB
securityfs_if.c -rw-r--r-- 7.4 KB
tomoyo.c -rw-r--r-- 14.6 KB
util.c -rw-r--r-- 27.0 KB

back to top