Skip to content

Commit

Permalink
Merge tag 'integrity-6.15-rc3-fix' of https://github.com/linux-integr…
Browse files Browse the repository at this point in the history
…ity/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
  • Loading branch information
Linus Torvalds committed Apr 22, 2025
2 parents a33b5a0 + 30d68cb commit e4b51cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion security/integrity/ima/ima_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,9 @@ static int process_measurement(struct file *file, const struct cred *cred,
&allowed_algos);
violation_check = ((func == FILE_CHECK || func == MMAP_CHECK ||
func == MMAP_CHECK_REQPROT) &&
(ima_policy_flag & IMA_MEASURE));
(ima_policy_flag & IMA_MEASURE) &&
((action & IMA_MEASURE) ||
(file->f_mode & FMODE_WRITE)));
if (!action && !violation_check)
return 0;

Expand Down

0 comments on commit e4b51cb

Please sign in to comment.