函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\integrity\ima\ima_policy.c Create Date:2022-07-27 22:03:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:ma_match_policy - decision based on LSM and other conditions*@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*@secid: LSM secid of the task to be

函数原型:int ima_match_policy(struct inode *inode, const struct cred *cred, unsigned int secid, enum ima_hooks func, int mask, int flags, int *pcr, struct ima_template_desc **template_desc)

返回类型:int

参数:

类型参数名称
struct inode *inode
const struct cred *cred
unsigned intsecid
enum ima_hooksfunc
intmask
intflags
int *pcr
struct ima_template_desc **template_desc
497  action等于0, actmask等于flags按位或flags左移1位
499  如果template_desctemplate_desc等于ima_template_desc_current()
502  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
505  如果非action按位与actmask的值则继续下一循环
508  如果非ma_match_rules - determine whether an inode matches the policy rule则继续下一循环
511  action或等于flags按位与 cache flags
513  action或等于action按位与IMA_DO_MASK
514  如果action按位与IMA_APPRAISE
515  action或等于In addition to knowing that we need to appraise the file in general,* we need to differentiate between calling hooks, for hook specific rules.
516  action与等于IMA_HASH的反
517  如果ima_fail_unverifiable_sigsaction或等于IMA_FAIL_UNVERIFIABLE_SIGS
522  如果action按位与IMA_DO_MASKactmask与等于action按位或action左移1位的值的反
524  否则actmask与等于action按位或action右移1位的值的反
527  如果pcrflags按位与IMA_PCRpcr等于 uid_eq(), uid_gt(), uid_lt()
530  如果template_desctemplatetemplate_desc等于template
533  如果非actmask退出
536  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
538  返回:action
调用者
名称描述
ima_must_appraisema_must_appraise - set appraise flag* Return 1 to appraise or hash