@@ -2101,11 +2101,16 @@
critical data.
The "digest_cache_measure" policy measures digest lists
- into PCR 12 (can be changed with kernel config).
+ into PCR 12 (can be changed with kernel config), enables
+ the digest cache to be used for the other selected
+ measure rules (if compatible), and measures the files
+ with digest not found in the digest list into PCR 12
+ (changeable).
The "digest_cache_appraise" policy appraises digest
lists with IMA signatures or module-style appended
- signatures.
+ signatures, and enables the digest cache to be used for
+ the other selected appraise rules (if compatible).
ima_tcb [IMA] Deprecated. Use ima_policy= instead.
Load a policy which meets the needs of the Trusted
@@ -930,6 +930,20 @@ static void add_rules(struct ima_rule_entry *entries, int count,
for (i = 0; i < count; i++) {
struct ima_rule_entry *entry;
+ if (IS_ENABLED(CONFIG_INTEGRITY_DIGEST_CACHE) &&
+ entries[i].action == MEASURE && ima_digest_cache_measure &&
+ ima_digest_cache_func_allowed(entries[i].func)) {
+ entries[i].digest_cache_usage |= IMA_DIGEST_CACHE_MEASURE_DATA;
+ entries[i].pcr = CONFIG_IMA_DIGEST_CACHE_MEASURE_PCR_IDX;
+ entries[i].flags |= IMA_PCR;
+ }
+
+ if (IS_ENABLED(CONFIG_INTEGRITY_DIGEST_CACHE) &&
+ entries[i].action == APPRAISE &&
+ ima_digest_cache_appraise &&
+ ima_digest_cache_func_allowed(entries[i].func))
+ entries[i].digest_cache_usage |= IMA_DIGEST_CACHE_APPRAISE_DATA;
+
if (policy_rule & IMA_DEFAULT_POLICY)
list_add_tail(&entries[i].list, &ima_default_rules);