Function report |
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 activity | Download SCCT | Chinese |
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:
| Type | Parameter | Name |
|---|---|---|
| struct ima_rule_entry * | rule | |
| struct inode * | inode | |
| const struct cred * | cred | |
| unsigned int | secid | |
| enum ima_hooks | func | |
| int | mask |
| 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 |
| 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 |
| 402 | If Not uid_op( effective UID of the task , uid) && Not uid_op( saved UID of the task , uid) && Not uid_op( real UID of the task , uid) Then Return false |
| 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 |
| 417 | If Not LSM file metadata specific Then |
| 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 |
| 427 | security_inode_getsecid(inode, & osid) |
| 432 | Break |
| 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 |
| Name | Describe |
|---|---|
| ima_match_policy | 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 |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |