ima_match_policy(9)
π ima_match_policy β decision based on LSM and other conditions π
okay so bestie, welcome to the ima_match_policy(9) page from the Kernel API Manual. This is the function that makes a decision based on LSM and other conditions, and we are going to cover every single detail together. no cap, every detail stays β¨
πΈ NAME πΈ
ima_match_policy β decision based on LSM and other conditions.
β¨ SYNOPSIS β¨
int ima_match_policy (struct mnt_idmap *idmap , struct inode *inode ,
const struct cred *cred , struct lsm_prop *prop , enum ima_hooks func ,
int mask , int flags , int *pcr , struct ima_template_desc
**template_desc , const char *func_data , unsigned int *allowed_algos );
π ARGUMENTS π
idmapβ idmap of the mount the inode was found from.inodeβ pointer to an inode for which the policy decision is being made.credβ pointer to a credentials structure for which the policy decision is being made.propβ LSM properties of the task to be validated.funcβ IMA hook identifier.maskβ requested action (MAY_READ | MAY_WRITE | MAY_APPEND | MAY_EXEC).flagsβ IMA actions to consider (e.g.IMA_MEASURE | IMA_APPRAISE).pcrβ set the pcr to extend.template_descβ the template that should be used for this rule.func_dataβ func specific data, may beNULL.allowed_algosβ allowlist of hash algorithms for the IMA xattr.
π¦ DESCRIPTION π¦
This is the measure decision, based on func/mask/fsmagic and LSM(subj/obj/type) conditions. itβs giving policy-decision main character energy π
Since the IMA policy may be updated multiple times, we need to lock the list when walking it. Reads are many orders of magnitude more numerous than writes, so ima_match_policy is a classical RCU candidate. highkey a very important little lock-and-read situation π₯
π₯ SEE ALSO π₯
- Kernel file
./security/integrity/ima/ima_policy.c ima_match_rule_data(9)ima_match_rules(9)ima_update_policy_flags(9)ima_init_policy(9)ima_update_policy(9)ima_parse_add_rule(9)ima_delete_rules(9)ima_measure_loaded_policy(9)
Cute sign-off time, bestie: this pageβs source/version is ./security/integrity/ima, its date is October 2026, and its manual-name moment is ima_match_policy(9) π«Άβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms