+static bool ima_match_keyring(struct ima_rule_entry *rule,
+ const char *keyring, const struct cred *cred)
+{
+ char *keyrings, *next_keyring, *keyrings_ptr;
+ bool matched = false;
+
+ /* If "keyrings=" is not specified all keys are measured. */
With the addiitonal "uid" support this isn't necessarily true any
more.
Mimi
+ if (!rule->keyrings)
+ return true;
+
+ if (!keyring)
+ return false;
+
+ if ((rule->flags & IMA_UID) && !rule->uid_op(cred->uid, rule->uid))
+ return false;
+