Skip to content

Commit e4b51cb

Browse files
committed
Merge tag 'integrity-6.15-rc3-fix' of https://github.com/linux-integrity/linux
Pull integrity fix from Roberto Sassu: "One performance fix to avoid unnecessarily taking the inode lock" * tag 'integrity-6.15-rc3-fix' of https://github.com/linux-integrity/linux: ima: process_measurement() needlessly takes inode_lock() on MAY_READ
2 parents a33b5a0 + 30d68cb commit e4b51cb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

security/integrity/ima/ima_main.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,9 @@ static int process_measurement(struct file *file, const struct cred *cred,
245245
&allowed_algos);
246246
violation_check = ((func == FILE_CHECK || func == MMAP_CHECK ||
247247
func == MMAP_CHECK_REQPROT) &&
248-
(ima_policy_flag & IMA_MEASURE));
248+
(ima_policy_flag & IMA_MEASURE) &&
249+
((action & IMA_MEASURE) ||
250+
(file->f_mode & FMODE_WRITE)));
249251
if (!action && !violation_check)
250252
return 0;
251253

0 commit comments

Comments
 (0)