Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\integrity\ima\ima_policy.c Create Date:2022-07-28 19:58:57
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:ma_match_rules - determine whether an inode matches the policy rule

Proto: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)

Type:bool

Parameter:

TypeParameterName
struct ima_rule_entry *rule
struct inode *inode
const struct cred *cred
unsigned intsecid
enum ima_hooksfunc
intmask
375  If func == KEXEC_CMDLINE Then
376  If flags & lags definitions && func == func Then Return true
378  Return false
380  If flags & lags definitions && func != func && func != POST_SETATTR Then Return false
383  If flags & IMA_MASK && mask != mask && func != POST_SETATTR Then Return false
386  If flags & IMA_INMASK && Not (mask & mask) && func != POST_SETATTR Then Return false
389  If flags & IMA_FSMAGIC && fsmagic != s_magic Then Return false
392  If flags & IMA_FSNAME && strcmp(fsname, name) Then Return false
395  If flags & IMA_FSUUID && Not uuid_equal( & fsuuid, & s_uuid) Then Return false
398  If flags & IMA_UID && Not uid_op( real UID of the task , uid) Then Return false
400  If flags & IMA_EUID Then
406  Else if Not uid_op( effective UID of the task , uid) Then Return false
410  If flags & IMA_FOWNER && Not fowner_op(i_uid, fowner) Then Return false
413  When i < MAX_LSM_RULES cycle
414  rc = 0
418  If Not audit value Then Continue
420  Else Return false
424  Case i == LSM_OBJ_USER
425  Case i == LSM_OBJ_ROLE
426  Case i == LSM_OBJ_TYPE
433  Case i == LSM_SUBJ_USER
434  Case i == LSM_SUBJ_ROLE
435  Case i == LSM_SUBJ_TYPE
440  Default
441  Break
443  If Not rc Then Return false
446  Return true
Caller
NameDescribe
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