return ima_match_policy(inode, function, mask, flags);
}
-int ima_must_measure(struct inode *inode, int mask, int function)
-{
- return ima_match_policy(inode, function, mask, IMA_MEASURE);
-}
-
/*
* ima_collect_measurement - collect file measurement
*
*/
static void ima_rdwr_violation_check(struct file *file,
struct integrity_iint_cache *iint,
+ int must_measure,
char **pathbuf,
const char **pathname)
{
send_tomtou = true;
}
} else {
- if ((atomic_read(&inode->i_writecount) > 0) &&
- ima_must_measure(inode, MAY_READ, FILE_CHECK))
+ if ((atomic_read(&inode->i_writecount) > 0) && must_measure)
send_writers = true;
}
* Included is the appraise submask.
*/
action = ima_get_action(inode, mask, function);
- violation_check = (function == FILE_CHECK &&
+ violation_check = ((function == FILE_CHECK || function == MMAP_CHECK) &&
(ima_policy_flag & IMA_MEASURE));
if (!action && !violation_check)
return 0;
}
if (violation_check) {
- ima_rdwr_violation_check(file, iint, &pathbuf, &pathname);
+ ima_rdwr_violation_check(file, iint, action & IMA_MEASURE,
+ &pathbuf, &pathname);
if (!action) {
rc = 0;
goto out_free;