Skip to content

Commit

Permalink
Merge tag 'lsm-pr-20241129' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/pcmoore/lsm

Pull ima fix from Paul Moore:
 "One small patch to fix a function parameter / local variable naming
  snafu that went up to you in the current merge window"

* tag 'lsm-pr-20241129' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm:
  ima: uncover hidden variable in ima_match_rules()
  • Loading branch information
torvalds committed Dec 1, 2024
2 parents cfd4730 + a65d9d1 commit 8a6a03a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions security/integrity/ima/ima_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ static bool ima_match_rules(struct ima_rule_entry *rule,
return false;
for (i = 0; i < MAX_LSM_RULES; i++) {
int rc = 0;
struct lsm_prop prop = { };
struct lsm_prop inode_prop = { };

if (!lsm_rule->lsm[i].rule) {
if (!lsm_rule->lsm[i].args_p)
Expand All @@ -649,15 +649,16 @@ static bool ima_match_rules(struct ima_rule_entry *rule,
case LSM_OBJ_USER:
case LSM_OBJ_ROLE:
case LSM_OBJ_TYPE:
security_inode_getlsmprop(inode, &prop);
rc = ima_filter_rule_match(&prop, lsm_rule->lsm[i].type,
security_inode_getlsmprop(inode, &inode_prop);
rc = ima_filter_rule_match(&inode_prop,
lsm_rule->lsm[i].type,
Audit_equal,
lsm_rule->lsm[i].rule);
break;
case LSM_SUBJ_USER:
case LSM_SUBJ_ROLE:
case LSM_SUBJ_TYPE:
rc = ima_filter_rule_match(&prop, lsm_rule->lsm[i].type,
rc = ima_filter_rule_match(prop, lsm_rule->lsm[i].type,
Audit_equal,
lsm_rule->lsm[i].rule);
break;
Expand Down

0 comments on commit 8a6a03a

Please sign in to comment.