Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\util.c Create Date:2022-07-28 19:48:17
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:moyo_domain_quota_is_ok - Check for domain's quota.*@r: Pointer to "struct tomoyo_request_info".* Returns true if the domain is not exceeded quota, false otherwise.* Caller holds tomoyo_read_lock().

Proto:bool tomoyo_domain_quota_is_ok(struct tomoyo_request_info *r)

Type:bool

Parameter:

TypeParameterName
struct tomoyo_request_info *r
1024  count = 0
1025  domain = domain
1028  If One of tomoyo_mode_index . != TOMOYO_CONFIG_LEARNING Then Return false
1030  If Not domain Then Return true
1037  If true or false or TOMOYO_GC_IN_PROGRESS Then Continue
1040  Case One of values in "enum tomoyo_acl_entry_type_index". == TOMOYO_TYPE_PATH_ACL
1041  perm = ({
1042  __mptr = ptr
1042  Do
1042  When 0 cycle
1042  })->perm
1043  Break
1044  Case One of values in "enum tomoyo_acl_entry_type_index". == TOMOYO_TYPE_PATH2_ACL
1045  perm = ({
1046  __mptr = ptr
1046  Do
1046  When 0 cycle
1046  })->perm
1047  Break
1048  Case One of values in "enum tomoyo_acl_entry_type_index". == TOMOYO_TYPE_PATH_NUMBER_ACL
1049  perm = ({
1050  __mptr = ptr
1050  Do
1050  When 0 cycle
1050  })->perm
1051  Break
1052  Case One of values in "enum tomoyo_acl_entry_type_index". == TOMOYO_TYPE_MKDEV_ACL
1053  perm = ({
1054  __mptr = ptr
1054  Do
1054  When 0 cycle
1054  })->perm
1055  Break
1056  Case One of values in "enum tomoyo_acl_entry_type_index". == TOMOYO_TYPE_INET_ACL
1057  perm = ({
1058  __mptr = ptr
1058  Do
1058  When 0 cycle
1058  })->perm
1059  Break
1060  Case One of values in "enum tomoyo_acl_entry_type_index". == TOMOYO_TYPE_UNIX_ACL
1061  perm = ({
1062  __mptr = ptr
1062  Do
1062  When 0 cycle
1062  })->perm
1063  Break
1064  Case One of values in "enum tomoyo_acl_entry_type_index". == TOMOYO_TYPE_MANUAL_TASK_ACL
1065  perm = 0
1066  Break
1067  Default
1068  perm = 1
1070  When i < 16 cycle If perm & 1 << i Then
1072  count++
1074  If count < pref[TOMOYO_PREF_MAX_LEARNING_ENTRY] Then Return true
1077  If Not flags[TOMOYO_DIF_QUOTA_WARNED] Then
1078  flags[TOMOYO_DIF_QUOTA_WARNED] = true
1080  moyo_write_log - Write an audit log.*@r: Pointer to "struct tomoyo_request_info".*@fmt: The printf()'s format string, followed by parameters.* Returns nothing.
1082  pr_warn("WARNING: Domain '%s' has too many ACLs to hold. Stopped learning mode.\n", name)
1086  Return false
Caller
NameDescribe
tomoyo_supervisormoyo_supervisor - Ask for the supervisor's decision