Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Requires: @profile->ns->lock held

Proto:int __aafs_profile_mkdir(struct aa_profile *profile, struct dentry *parent)

Type:int

Parameter:

TypeParameterName
struct aa_profile *profile
struct dentry *parent
1701  dent = NULL
1704  AA_BUG(!profile)
1705  AA_BUG(!mutex_is_locked( & lock))
1707  If Not parent Then
1709  p = aa_deref_parent(profile)
1710  dent = prof_dir(p)
1712  dent = aafs_create_dir - create a directory in the apparmorfs filesystem*@name: name of dentry to create*@parent: parent directory for this dentry* see aafs_create
1713  If IS_ERR(dent) Then Go to fail
1715  prof_child_dir(p) = parent = dent
1718  If Not dirname Then
1720  len = aa_mangle_name - mangle a profile name to std profile layout form*@name: profile name to mangle (NOT NULL)*@target: buffer to store mangled name, same length as @name (MAYBE NULL)* Returns: length of mangled name
1721  id_len = snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
1723  dirname = Allocation memory
1724  If Not dirname Then
1725  error = -ENOMEM
1726  Go to fail2
1729  aa_mangle_name - mangle a profile name to std profile layout form*@name: profile name to mangle (NOT NULL)*@target: buffer to store mangled name, same length as @name (MAYBE NULL)* Returns: length of mangled name
1730  sprintf(dirname + len, ".%ld", uniq_id++)
1733  dent = aafs_create_dir - create a directory in the apparmorfs filesystem*@name: name of dentry to create*@parent: parent directory for this dentry* see aafs_create
1734  If IS_ERR(dent) Then Go to fail
1736  prof_dir(profile) = dir = dent
1738  dent = create_profile_file(dir, "name", profile, & seq_profile_name_fops)
1740  If IS_ERR(dent) Then Go to fail
1742  dents[AAFS_PROF_NAME] = dent
1744  dent = create_profile_file(dir, "mode", profile, & seq_profile_mode_fops)
1746  If IS_ERR(dent) Then Go to fail
1748  dents[AAFS_PROF_MODE] = dent
1750  dent = create_profile_file(dir, "attach", profile, & seq_profile_attach_fops)
1752  If IS_ERR(dent) Then Go to fail
1754  dents[AAFS_PROF_ATTACH] = dent
1756  If hash Then
1757  dent = create_profile_file(dir, "sha1", profile, & seq_profile_hash_fops)
1759  If IS_ERR(dent) Then Go to fail
1761  dents[AAFS_PROF_HASH] = dent
1764  If rawdata Then
1765  dent = aafs_create_symlink - create a symlink in the apparmorfs filesystem*@name: name of dentry to create*@parent: parent directory for this dentry*@target: if symlink, symlink target string*@private: private data*@iops: struct of inode_operations that should
1768  If IS_ERR(dent) Then Go to fail
1770  aa_get_proxy(proxy)
1771  dents[AAFS_PROF_RAW_HASH] = dent
1773  dent = aafs_create_symlink - create a symlink in the apparmorfs filesystem*@name: name of dentry to create*@parent: parent directory for this dentry*@target: if symlink, symlink target string*@private: private data*@iops: struct of inode_operations that should
1776  If IS_ERR(dent) Then Go to fail
1778  aa_get_proxy(proxy)
1779  dents[AAFS_PROF_RAW_ABI] = dent
1781  dent = aafs_create_symlink - create a symlink in the apparmorfs filesystem*@name: name of dentry to create*@parent: parent directory for this dentry*@target: if symlink, symlink target string*@private: private data*@iops: struct of inode_operations that should
1784  If IS_ERR(dent) Then Go to fail
1786  aa_get_proxy(proxy)
1787  dents[AAFS_PROF_RAW_DATA] = dent
1791  error = Requires: @profile->ns->lock held
1792  If error Then Go to fail2
1796  Return 0
1798  fail :
1799  error = PTR_ERR(dent)
1801  fail2 :
1802  Requires: @profile->ns->lock held
1804  Return error
Caller
NameDescribe
__aafs_profile_mkdirRequires: @profile->ns->lock held
__aafs_ns_mkdirRequires: @ns->lock held
aa_replace_profilesaa_replace_profiles - replace profile(s) on the profile list*@policy_ns: namespace load is occurring on*@label: label that is attempting to load/replace policy*@mask: permission mask*@udata: serialized data stream (NOT NULL)* unpack and replace a profile