1
vfs_rmdir: call lsm hook before unhashing dentry
3
If we unhash the dentry before calling the security_inode_rmdir hook,
4
we cannot compute the file's pathname in the hook anymore.
6
Signed-off-by: John Johansen <jjohansen@suse.de>
7
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
10
===================================================================
13
@@ -2016,6 +2016,10 @@ int vfs_rmdir(struct inode *dir, struct
14
if (!dir->i_op || !dir->i_op->rmdir)
17
+ error = security_inode_rmdir(dir, dentry, mnt);
23
mutex_lock(&dentry->d_inode->i_mutex);
24
@@ -2023,12 +2027,9 @@ int vfs_rmdir(struct inode *dir, struct
25
if (d_mountpoint(dentry))
28
- error = security_inode_rmdir(dir, dentry, mnt);
30
- error = dir->i_op->rmdir(dir, dentry);
32
- dentry->d_inode->i_flags |= S_DEAD;
34
+ error = dir->i_op->rmdir(dir, dentry);
36
+ dentry->d_inode->i_flags |= S_DEAD;
38
mutex_unlock(&dentry->d_inode->i_mutex);