函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:aa_label_strn_parse - parse, validate and convert a text string to a label*@base: base label to use for lookups (NOT NULL)*@str: null terminated text string (NOT NULL)*@n: length of str to parse, will stop at \0 if encountered before n*@gfp: allocation

函数原型:struct aa_label *aa_label_strn_parse(struct aa_label *base, const char *str, size_t n, gfp_t gfp, bool create, bool force_stack)

返回类型:struct aa_label

参数:

类型参数名称
struct aa_label *base
const char *str
size_tn
gfp_tgfp
boolcreate
boolforce_stack
1861  DEFINE_VEC(profile, vec)
1862  currbase等于base
1863  stack等于0
1864  end等于strn
1867  AA_BUG(!base)
1868  AA_BUG(!str)
1870  str等于skipn_spaces - Removes leading whitespace from @str.*@str: The string to be stripped.* Returns a pointer to the first non-whitespace character in @str.* if all whitespace will return NULL
1871  如果str恒等于NULLstr恒等于'='且base不等于label则返回:错误号
1874  len等于label_count_strn_entries(str, end - str)
1875  如果str恒等于'&'或force_stack
1877  stack等于size
1878  len加等于stack
1879  如果str恒等于'&'则str自加
1883  error等于vec_setup(profile, vec, len, gfp)
1884  如果error则返回:错误号
1887 i小于stack循环vec[i]等于aa_get_profile - increment refcount on profile @p*@p: profile (MAYBE NULL)* Returns: pointer to @p if @p is NULL will return NULL* Requires: @p must be held with valid refcount when called
1890 spliti小于len循环
1892  vec[i]等于sure stacks with components like* :ns:A//&B* have :ns: applied to both 'A' and 'B' by making the lookup relative* to the base if the lookup specifies an ns, else making the stacked lookup* relative to the last embedded ns in the string.
1893  如果非vec[i]则转到:fail
1899  如果ns不等于labels_ns(currbase)则currbase等于label
1901  str等于split加3
1902  split等于aa_label_strn_split(str, end - str)
1905  如果i小于len
1906  vec[i]等于sure stacks with components like* :ns:A//&B* have :ns: applied to both 'A' and 'B' by making the lookup relative* to the base if the lookup specifies an ns, else making the stacked lookup* relative to the last embedded ns in the string.
1907  如果非vec[i]则转到:fail
1910  如果len恒等于1则返回:label
1914  len减等于aa_vec_unique - canonical sort and unique a list of profiles*@n: number of refcounted profiles in the list (@n > 0)*@vec: list of profiles to sort and merge* Returns: the number of duplicates eliminated == references put* If @flags & VEC_FLAG_TERMINATE
1916  如果len恒等于1则
1917  label等于aa_get_label( & label)
1918  转到:out
1921  如果createlabel等于aa_vec_find_or_create_label(vec, len, gfp)
1923  否则label等于vec_find - find label @l in label set*@vec: array of profiles to find equiv label for (NOT NULL)*@n: length of @vec* Returns: refcounted label if @vec equiv is in tree* else NULL if @vec equiv is not in tree
1925  如果非label则转到:fail
1928  out :
1930  vec_cleanup(profile, vec, len)
1931  返回:label
1933  fail :
1934  label等于错误号
1935  转到:out
调用者
名称描述
aa_label_parse
apparmor_secctx_to_secid