aboutsummaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorMimi Zohar <zohar@linux.vnet.ibm.com>2010-11-02 10:13:07 -0400
committerMimi Zohar <zohar@linux.vnet.ibm.com>2011-02-10 07:51:44 -0500
commit890275b5eb79e9933d12290473eab9ac38da0051 (patch)
tree8fa529a6fdfa7647ed4e14287658b71df8636ddd /fs/open.c
parenta5c96ebf1d71df0c5fb77ab58c9aeb307cf02372 (diff)
IMA: maintain i_readcount in the VFS layer
ima_counts_get() updated the readcount and invalidated the PCR, as necessary. Only update the i_readcount in the VFS layer. Move the PCR invalidation checks to ima_file_check(), where it belongs. Maintaining the i_readcount in the VFS layer, will allow other subsystems to use i_readcount. Signed-off-by: Mimi Zohar <zohar@us.ibm.com> Acked-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/open.c b/fs/open.c
index 4197b9ed023d..0d485c50bb95 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -688,7 +688,8 @@ static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt,
688 if (error) 688 if (error)
689 goto cleanup_all; 689 goto cleanup_all;
690 } 690 }
691 ima_counts_get(f); 691 if ((f->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ)
692 i_readcount_inc(inode);
692 693
693 f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC); 694 f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
694 695