aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/tomoyo/file.c')
-rw-r--r--security/tomoyo/file.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/security/tomoyo/file.c b/security/tomoyo/file.c
index 400390790745..c151a1869597 100644
--- a/security/tomoyo/file.c
+++ b/security/tomoyo/file.c
@@ -905,11 +905,9 @@ int tomoyo_path2_perm(const u8 operation, struct path *path1,
905 !tomoyo_get_realpath(&buf2, path2)) 905 !tomoyo_get_realpath(&buf2, path2))
906 goto out; 906 goto out;
907 switch (operation) { 907 switch (operation) {
908 struct dentry *dentry;
909 case TOMOYO_TYPE_RENAME: 908 case TOMOYO_TYPE_RENAME:
910 case TOMOYO_TYPE_LINK: 909 case TOMOYO_TYPE_LINK:
911 dentry = path1->dentry; 910 if (!d_is_dir(path1->dentry))
912 if (!dentry->d_inode || !S_ISDIR(dentry->d_inode->i_mode))
913 break; 911 break;
914 /* fall through */ 912 /* fall through */
915 case TOMOYO_TYPE_PIVOT_ROOT: 913 case TOMOYO_TYPE_PIVOT_ROOT: