aboutsummaryrefslogtreecommitdiffstats
path: root/security/integrity
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-23 17:07:38 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-22 23:31:31 -0500
commit496ad9aa8ef448058e36ca7a787c61f2e63f0f54 (patch)
tree8f4abde793cd7db5bb8fde6d27ebcacd0e54379a /security/integrity
parent57eccb830f1cc93d4b506ba306d8dfa685e0c88f (diff)
new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security/integrity')
-rw-r--r--security/integrity/ima/ima_api.c6
-rw-r--r--security/integrity/ima/ima_crypto.c2
-rw-r--r--security/integrity/ima/ima_main.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/security/integrity/ima/ima_api.c b/security/integrity/ima/ima_api.c
index 0cea3db21657..27cb9eb42cc8 100644
--- a/security/integrity/ima/ima_api.c
+++ b/security/integrity/ima/ima_api.c
@@ -140,12 +140,12 @@ int ima_must_measure(struct inode *inode, int mask, int function)
140int ima_collect_measurement(struct integrity_iint_cache *iint, 140int ima_collect_measurement(struct integrity_iint_cache *iint,
141 struct file *file) 141 struct file *file)
142{ 142{
143 struct inode *inode = file->f_dentry->d_inode; 143 struct inode *inode = file_inode(file);
144 const char *filename = file->f_dentry->d_name.name; 144 const char *filename = file->f_dentry->d_name.name;
145 int result = 0; 145 int result = 0;
146 146
147 if (!(iint->flags & IMA_COLLECTED)) { 147 if (!(iint->flags & IMA_COLLECTED)) {
148 u64 i_version = file->f_dentry->d_inode->i_version; 148 u64 i_version = file_inode(file)->i_version;
149 149
150 iint->ima_xattr.type = IMA_XATTR_DIGEST; 150 iint->ima_xattr.type = IMA_XATTR_DIGEST;
151 result = ima_calc_hash(file, iint->ima_xattr.digest); 151 result = ima_calc_hash(file, iint->ima_xattr.digest);
@@ -182,7 +182,7 @@ void ima_store_measurement(struct integrity_iint_cache *iint,
182 const char *op = "add_template_measure"; 182 const char *op = "add_template_measure";
183 const char *audit_cause = "ENOMEM"; 183 const char *audit_cause = "ENOMEM";
184 int result = -ENOMEM; 184 int result = -ENOMEM;
185 struct inode *inode = file->f_dentry->d_inode; 185 struct inode *inode = file_inode(file);
186 struct ima_template_entry *entry; 186 struct ima_template_entry *entry;
187 int violation = 0; 187 int violation = 0;
188 188
diff --git a/security/integrity/ima/ima_crypto.c b/security/integrity/ima/ima_crypto.c
index b21ee5b5495a..81dcaa26401e 100644
--- a/security/integrity/ima/ima_crypto.c
+++ b/security/integrity/ima/ima_crypto.c
@@ -63,7 +63,7 @@ int ima_calc_hash(struct file *file, char *digest)
63 file->f_mode |= FMODE_READ; 63 file->f_mode |= FMODE_READ;
64 read = 1; 64 read = 1;
65 } 65 }
66 i_size = i_size_read(file->f_dentry->d_inode); 66 i_size = i_size_read(file_inode(file));
67 while (offset < i_size) { 67 while (offset < i_size) {
68 int rbuf_len; 68 int rbuf_len;
69 69
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
index dba965de90d3..e7a147f7d371 100644
--- a/security/integrity/ima/ima_main.c
+++ b/security/integrity/ima/ima_main.c
@@ -132,7 +132,7 @@ static void ima_check_last_writer(struct integrity_iint_cache *iint,
132 */ 132 */
133void ima_file_free(struct file *file) 133void ima_file_free(struct file *file)
134{ 134{
135 struct inode *inode = file->f_dentry->d_inode; 135 struct inode *inode = file_inode(file);
136 struct integrity_iint_cache *iint; 136 struct integrity_iint_cache *iint;
137 137
138 if (!iint_initialized || !S_ISREG(inode->i_mode)) 138 if (!iint_initialized || !S_ISREG(inode->i_mode))
@@ -148,7 +148,7 @@ void ima_file_free(struct file *file)
148static int process_measurement(struct file *file, const unsigned char *filename, 148static int process_measurement(struct file *file, const unsigned char *filename,
149 int mask, int function) 149 int mask, int function)
150{ 150{
151 struct inode *inode = file->f_dentry->d_inode; 151 struct inode *inode = file_inode(file);
152 struct integrity_iint_cache *iint; 152 struct integrity_iint_cache *iint;
153 unsigned char *pathname = NULL, *pathbuf = NULL; 153 unsigned char *pathname = NULL, *pathbuf = NULL;
154 int rc = -ENOMEM, action, must_appraise; 154 int rc = -ENOMEM, action, must_appraise;