Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:aa_setprocattr_chagnehat - handle procattr interface to change_hat*@args: args received from writing to /proc/<pid>/attr/current (NOT NULL)*@size: size of the args*@flags: set of flags governing behavior* Returns: %0 or error code if change_hat fails

Proto:int aa_setprocattr_changehat(char *args, size_t size, int flags)

Type:int

Parameter:

TypeParameterName
char *args
size_tsize
intflags
107  count = 0
109  hat = split_token_from_name - separate a string of form ^*@op: operation being checked*@args: string to parse (NOT NULL)*@token: stores returned parsed token value (NOT NULL)* Returns: start position of name after token else NULL on failure
110  If IS_ERR(hat) Then Return PTR_ERR(hat)
113  If Not hat && Not token Then
114  AA_ERROR("change_hat: Invalid input, NULL hat and NULL magic")
115  Return -EINVAL
118  If hat Then
125  end = args + size
126  When hat < end && count < 16 cycle
128  hats[count] = hat
129  AA_DEBUG("%s: (pid %d) Magic 0x%llx count %d hat '%s'\n", __func__, pid, token, count, hat)
131  hat = next
133  Else AA_DEBUG("%s: (pid %d) Magic 0x%llx count %d Hat '%s'\n", __func__, pid, token, count, "<NULL>")
137  Return aa_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
Caller
NameDescribe
apparmor_setprocattr