diff options
Diffstat (limited to 'security/integrity/ima')
-rw-r--r-- | security/integrity/ima/ima_main.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c index 7689c1e21f09..09baa335ebc7 100644 --- a/security/integrity/ima/ima_main.c +++ b/security/integrity/ima/ima_main.c | |||
@@ -91,8 +91,13 @@ static void ima_rdwr_violation_check(struct file *file) | |||
91 | mutex_lock(&inode->i_mutex); /* file metadata: permissions, xattr */ | 91 | mutex_lock(&inode->i_mutex); /* file metadata: permissions, xattr */ |
92 | 92 | ||
93 | if (mode & FMODE_WRITE) { | 93 | if (mode & FMODE_WRITE) { |
94 | if (atomic_read(&inode->i_readcount) && IS_IMA(inode)) | 94 | if (atomic_read(&inode->i_readcount) && IS_IMA(inode)) { |
95 | send_tomtou = true; | 95 | struct integrity_iint_cache *iint; |
96 | iint = integrity_iint_find(inode); | ||
97 | /* IMA_MEASURE is set from reader side */ | ||
98 | if (iint && (iint->flags & IMA_MEASURE)) | ||
99 | send_tomtou = true; | ||
100 | } | ||
96 | } else { | 101 | } else { |
97 | if ((atomic_read(&inode->i_writecount) > 0) && | 102 | if ((atomic_read(&inode->i_writecount) > 0) && |
98 | ima_must_measure(inode, MAY_READ, FILE_CHECK)) | 103 | ima_must_measure(inode, MAY_READ, FILE_CHECK)) |