diff options
Diffstat (limited to 'security/integrity/ima/ima_appraise.c')
-rw-r--r-- | security/integrity/ima/ima_appraise.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/security/integrity/ima/ima_appraise.c b/security/integrity/ima/ima_appraise.c index a4605d677248..225fd944a4ef 100644 --- a/security/integrity/ima/ima_appraise.c +++ b/security/integrity/ima/ima_appraise.c | |||
@@ -183,7 +183,7 @@ int ima_read_xattr(struct dentry *dentry, | |||
183 | int ima_appraise_measurement(int func, struct integrity_iint_cache *iint, | 183 | int ima_appraise_measurement(int func, struct integrity_iint_cache *iint, |
184 | struct file *file, const unsigned char *filename, | 184 | struct file *file, const unsigned char *filename, |
185 | struct evm_ima_xattr_data *xattr_value, | 185 | struct evm_ima_xattr_data *xattr_value, |
186 | int xattr_len) | 186 | int xattr_len, int opened) |
187 | { | 187 | { |
188 | static const char op[] = "appraise_data"; | 188 | static const char op[] = "appraise_data"; |
189 | char *cause = "unknown"; | 189 | char *cause = "unknown"; |
@@ -203,7 +203,7 @@ int ima_appraise_measurement(int func, struct integrity_iint_cache *iint, | |||
203 | 203 | ||
204 | cause = "missing-hash"; | 204 | cause = "missing-hash"; |
205 | status = INTEGRITY_NOLABEL; | 205 | status = INTEGRITY_NOLABEL; |
206 | if (inode->i_size == 0) { | 206 | if (opened & FILE_CREATED) { |
207 | iint->flags |= IMA_NEW_FILE; | 207 | iint->flags |= IMA_NEW_FILE; |
208 | status = INTEGRITY_PASS; | 208 | status = INTEGRITY_PASS; |
209 | } | 209 | } |