Lines Matching refs:rule
71 void *rule; /* LSM file metadata specific */ member
229 if (!entry->lsm[i].rule) in ima_lsm_update_rules()
234 &entry->lsm[i].rule); in ima_lsm_update_rules()
235 BUG_ON(!entry->lsm[i].rule); in ima_lsm_update_rules()
249 static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode, in ima_match_rules() argument
256 if ((rule->flags & IMA_FUNC) && in ima_match_rules()
257 (rule->func != func && func != POST_SETATTR)) in ima_match_rules()
259 if ((rule->flags & IMA_MASK) && in ima_match_rules()
260 (rule->mask != mask && func != POST_SETATTR)) in ima_match_rules()
262 if ((rule->flags & IMA_INMASK) && in ima_match_rules()
263 (!(rule->mask & mask) && func != POST_SETATTR)) in ima_match_rules()
265 if ((rule->flags & IMA_FSMAGIC) in ima_match_rules()
266 && rule->fsmagic != inode->i_sb->s_magic) in ima_match_rules()
268 if ((rule->flags & IMA_FSUUID) && in ima_match_rules()
269 !uuid_equal(&rule->fsuuid, &inode->i_sb->s_uuid)) in ima_match_rules()
271 if ((rule->flags & IMA_UID) && !rule->uid_op(cred->uid, rule->uid)) in ima_match_rules()
273 if (rule->flags & IMA_EUID) { in ima_match_rules()
275 if (!rule->uid_op(cred->euid, rule->uid) in ima_match_rules()
276 && !rule->uid_op(cred->suid, rule->uid) in ima_match_rules()
277 && !rule->uid_op(cred->uid, rule->uid)) in ima_match_rules()
279 } else if (!rule->uid_op(cred->euid, rule->uid)) in ima_match_rules()
283 if ((rule->flags & IMA_FOWNER) && in ima_match_rules()
284 !rule->fowner_op(inode->i_uid, rule->fowner)) in ima_match_rules()
291 if (!rule->lsm[i].rule) in ima_match_rules()
300 rule->lsm[i].type, in ima_match_rules()
302 rule->lsm[i].rule, in ima_match_rules()
310 rule->lsm[i].type, in ima_match_rules()
312 rule->lsm[i].rule, in ima_match_rules()
332 static int get_subaction(struct ima_rule_entry *rule, enum ima_hooks func) in get_subaction() argument
334 if (!(rule->flags & IMA_FUNC)) in get_subaction()
571 if (entry->lsm[lsm_rule].rule) in ima_lsm_rule_init()
582 &entry->lsm[lsm_rule].rule); in ima_lsm_rule_init()
583 if (!entry->lsm[lsm_rule].rule) { in ima_lsm_rule_init()
608 static int ima_parse_rule(char *rule, struct ima_rule_entry *entry) in ima_parse_rule() argument
623 while ((p = strsep(&rule, " \t")) != NULL) { in ima_parse_rule()
902 ssize_t ima_parse_add_rule(char *rule) in ima_parse_add_rule() argument
910 p = strsep(&rule, "\n"); in ima_parse_add_rule()
1115 if (entry->lsm[i].rule) { in ima_policy_show()