函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:helper fn for changing into a hat* Returns: label for hat transition or ERR_PTR. Does not return NULL

函数原型:static struct aa_label *change_hat(struct aa_label *label, const char *hats[], int count, int flags)

返回类型:struct aa_label

参数:

类型参数名称
struct aa_label *label
const char *hats
intcount
intflags
1050  struct aa_profile * profile, * root, * hat = NULL
1053  bool sibling = false
1054  const char * name, * info = NULL
1057  AA_BUG(!label)
1058  AA_BUG(!hats)
1059  AA_BUG(count < 1)
1061  如果PROFILE_IS_HAT(labels_profile(label))则sibling = true
1065 i小于count且非hat循环
1066  name等于hats[i]
1068  如果siblingPROFILE_IS_HAT(profile)则
1070  否则如果非sibling且非PROFILE_IS_HAT(profile)则
1072  否则
1073  info等于"conflicting targets types"
1074  error等于负EPERM
1075  转到:fail
1077  hat等于aa_find_child - find a profile by @name in @parent*@parent: profile to search (NOT NULL)*@name: profile name to search for (NOT NULL)* Returns: a refcounted profile or NULL if not found
1078  aa_put_profile - decrement refcount on profile @p*@p: profile (MAYBE NULL)
1079  如果非hat
1080  如果非COMPLAIN_MODE(profile)则转到:outer_continue
1083  否则如果非PROFILE_IS_HAT(hat)则
1084  info等于"target not hat"
1085  error等于负EPERM
1087  转到:fail
1089  aa_put_profile - decrement refcount on profile @p*@p: profile (MAYBE NULL)
1092  转到:build
1093  outer_continue :
1102  name = NULL
1104  如果非链表为空
1105  info等于"hat not found"
1106  error等于负ENOENT
1107  转到:fail
1110  info等于"no hats defined"
1111  error等于负ECHILD
1113  fail :
1122  如果count大于1或COMPLAIN_MODE(profile)则
1123  aa_audit_file - handle the auditing of file operations*@profile: the profile being enforced (NOT NULL)*@perms: the permissions computed for the request (NOT NULL)*@op: operation being mediated*@request: permissions requested*@name: name of object being
1128  返回:错误号
1130  build :
1131  new等于fn_label_build_in_ns(label, profile, GFP_KERNEL, helper fn for change_hat* Returns: label for hat transition OR ERR_PTR. Does NOT return NULL, aa_get_label( & label))
1134  如果非new
1135  info等于"label build failed"
1136  error等于负ENOMEM
1137  转到:fail
1140  返回:new
调用者
名称描述
aa_change_hataa_change_hat - change hat to/from subprofile*@hats: vector of hat names to try changing into (MAYBE NULL if @count == 0)*@count: number of hat names in @hats*@token: magic value to validate the hat change*@flags: flags affecting behavior of the change