summaryrefslogtreecommitdiff
path: root/fs/namei.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-29 09:44:44 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-29 09:44:44 -0700
commitbb1e9b844b989fc9a4dfffbf7a064703cda2a6a6 (patch)
tree994d03a5525b8c82fda1fc41382f116cf6e3a40c /fs/namei.c
parente717f33e989dbe6446547d7ca97489a980056f3c (diff)
parent94e5d714f604d4cb4cb13163f01ede278e69258b (diff)
downloadlinux-next-bb1e9b844b989fc9a4dfffbf7a064703cda2a6a6.tar.gz
Merge branch 'bugfixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6
* 'bugfixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: integrity: add ima_counts_put (updated) integrity: ima audit hash_exists fix integrity: ima mq_open imbalance msg fix
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 5b961eb71cbf..f3c5b278895a 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1761,6 +1761,10 @@ do_last:
goto exit;
}
filp = nameidata_to_filp(&nd, open_flag);
+ if (IS_ERR(filp))
+ ima_counts_put(&nd.path,
+ acc_mode & (MAY_READ | MAY_WRITE |
+ MAY_EXEC));
mnt_drop_write(nd.path.mnt);
if (nd.root.mnt)
path_put(&nd.root);
@@ -1817,6 +1821,9 @@ ok:
goto exit;
}
filp = nameidata_to_filp(&nd, open_flag);
+ if (IS_ERR(filp))
+ ima_counts_put(&nd.path,
+ acc_mode & (MAY_READ | MAY_WRITE | MAY_EXEC));
/*
* It is now safe to drop the mnt write
* because the filp has had a write taken