函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:ma_match_rules - determine whether an inode matches the policy rule

函数原型:static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode, const struct cred *cred, unsigned int secid, enum ima_hooks func, int mask)

返回类型:bool

参数:

类型参数名称
struct ima_rule_entry *rule
struct inode *inode
const struct cred *cred
unsigned intsecid
enum ima_hooksfunc
intmask
375  如果func恒等于KEXEC_CMDLINE
376  如果flags按位与lags definitions func恒等于func则返回:true
378  返回:false
380  如果flags按位与lags definitions func不等于funcfunc不等于POST_SETATTR则返回:false
383  如果flags按位与IMA_MASKmask不等于maskfunc不等于POST_SETATTR则返回:false
386  如果flags按位与IMA_INMASK且非mask按位与mask的值且func不等于POST_SETATTR则返回:false
389  如果flags按位与IMA_FSMAGICfsmagic不等于s_magic则返回:false
392  如果flags按位与IMA_FSNAME字符串比较则返回:false
395  如果flags按位与IMA_FSUUID且非uuid_equal( & fsuuid, & s_uuid)则返回:false
398  如果flags按位与IMA_UID且非uid_op(进程uid, uid)则返回:false
400  如果flags按位与IMA_EUID
402  如果非uid_op(有效uid, uid)且非uid_op(保留uid, uid)且非uid_op(进程uid, uid)则返回:false
406  否则如果非uid_op(有效uid, uid)则返回:false
410  如果flags按位与IMA_FOWNER且非fowner_op(i_uid, fowner)则返回:false
413 i小于MAX_LSM_RULES循环
414  rc等于0
417  如果非 LSM file metadata specific
418  如果非 audit value 则继续下一循环
420  否则返回:false
424  :i恒等于LSM_OBJ_USER
425  :i恒等于LSM_OBJ_ROLE
426  :i恒等于LSM_OBJ_TYPE
433  :i恒等于LSM_SUBJ_USER
434  :i恒等于LSM_SUBJ_ROLE
435  :i恒等于LSM_SUBJ_TYPE
440  默认
441  退出
443  如果非rc则返回:false
446  返回:true
调用者
名称描述
ima_match_policyma_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