函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:moyo_get_condition - Parse condition part.*@param: Pointer to "struct tomoyo_acl_param".* Returns pointer to "struct tomoyo_condition" on success, NULL otherwise.

函数原型:struct tomoyo_condition *tomoyo_get_condition(struct tomoyo_acl_param *param)

返回类型:struct tomoyo_condition

参数:

类型参数名称
struct tomoyo_acl_param *param
497  struct tomoyo_condition * entry = NULL
498  struct tomoyo_condition_element * condp = NULL
499  struct tomoyo_number_union * numbers_p = NULL
500  struct tomoyo_name_union * names_p = NULL
501  struct tomoyo_argv * argv = NULL
502  struct tomoyo_envp * envp = NULL
503  struct tomoyo_condition e = {}
504  start_of_string等于moyo_get_transit_preference - Parse domain transition preference for execve().*@param: Pointer to "struct tomoyo_acl_param".*@e: Pointer to "struct tomoyo_condition".* Returns the condition string part.
506  end_of_string等于start_of_stringstrlen - Find the length of a string*@s: The string to be sized
509  rerun :
510  pos等于start_of_string
511  当1循环
512  left等于负1
513  right等于负1
514  left_word等于pos
519  如果非left_word退出
531  cp等于strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for
532  如果cp
533  cp等于'\0'
534  pos等于cp加1
535  否则
536  pos等于""
538  right_word等于strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for
539  如果非right_wordright_word恒等于left_word则转到:out
541  is_not等于*right_word减1的差恒等于'!'
542  如果is_not则 * (right_word++ - 1) = '\0'
544  否则如果*right_word加1的和不等于'='则right_word自加等于'\0'
546  否则转到:out
548  Define this to enable debug mode. (warning conditions "%u: <%s>%s=<%s>\n", __LINE__, left_word, is_not ? "!" : "", right_word)
550  如果非字符串比较
551  如果entry
562  继续下一循环
564  如果非字符串指定长度比较
565  如果非argv
568  否则
577  转到:store_value
579  如果非字符串指定长度比较
580  如果非envp
583  否则
592  转到:store_value
594  left等于moyo_condition_type - Get condition type.*@word: Keyword string.* Returns one of values in "enum tomoyo_conditions_index" on success,* TOMOYO_MAX_CONDITION_KEYWORD otherwise.
595  Define this to enable debug mode. (warning conditions "%u: <%s> left=%u\n", __LINE__, left_word, left)
597  如果left恒等于TOMOYO_MAX_CONDITION_KEYWORD
598  如果非numbers_p
600  否则
610  如果非condpNumber of conditions in this struct. 自加
612  否则Number of conditions in this struct. 自减
614  如果left恒等于TOMOYO_EXEC_REALPATHleft恒等于TOMOYO_SYMLINK_TARGET
616  如果非names_p
618  否则
626  转到:store_value
628  right等于moyo_condition_type - Get condition type.*@word: Keyword string.* Returns one of values in "enum tomoyo_conditions_index" on success,* TOMOYO_MAX_CONDITION_KEYWORD otherwise.
629  如果right恒等于TOMOYO_MAX_CONDITION_KEYWORD
630  如果非numbers_p
632  否则
641  store_value :
642  如果非condp
643  Define this to enable debug mode. (warning conditions "%u: dry_run left=%u right=%u match=%u\n", __LINE__, left, right, !is_not)
645  继续下一循环
647  Left hand operand. A "struct tomoyo_argv" for TOMOYO_ARGV_ENTRY, a* "struct tomoyo_envp" for TOMOYO_ENVP_ENTRY is attached to the tail* of the array of this struct.等于left
648  Right hand operand. A "struct tomoyo_number_union" for* TOMOYO_NUMBER_UNION, a "struct tomoyo_name_union" for* TOMOYO_NAME_UNION is attached to the tail of the array of this* struct.等于right
649  Equation operator. True if equals or overlaps, false otherwise. 等于非is_not
650  Define this to enable debug mode. (warning conditions "%u: left=%u right=%u match=%u\n", __LINE__, Left hand operand. A "struct tomoyo_argv" for TOMOYO_ARGV_ENTRY, a* "struct tomoyo_envp" for TOMOYO_ENVP_ENTRY is attached to the tail* of the array of this struct., Right hand operand. A "struct tomoyo_number_union" for* TOMOYO_NUMBER_UNION, a "struct tomoyo_name_union" for* TOMOYO_NAME_UNION is attached to the tail of the array of this* struct., Equation operator. True if equals or overlaps, false otherwise. )
653  condp自加
655  Define this to enable debug mode. (formational "%u: cond=%u numbers=%u names=%u ac=%u ec=%u\n", __LINE__, Number of conditions in this struct. , Number of "struct tomoyo_number_union values". , Number of "struct tomoyo_name_union names". , Number of "struct tomoyo_argv". , Number of "struct tomoyo_envp". )
658  如果entry
659  BUG_ON(Number of "struct tomoyo_name_union names". | Number of "struct tomoyo_number_union values". | Number of "struct tomoyo_argv". | Number of "struct tomoyo_envp". | Number of conditions in this struct. )
661  返回:moyo_commit_condition - Commit "struct tomoyo_condition".*@entry: Pointer to "struct tomoyo_condition".* Returns pointer to "struct tomoyo_condition" on success, NULL otherwise.* This function merges duplicated entries. This function returns NULL if
663  Memory size allocated for this entry. 等于entry的长度加Number of conditions in this struct. sizeof(structtomoyo_condition_element)加Number of "struct tomoyo_number_union values". sizeof(structtomoyo_number_union)加Number of "struct tomoyo_name_union names". sizeof(structtomoyo_name_union)加Number of "struct tomoyo_argv". moyo_argv - Check argv[] in "struct linux_binbrm".*@index: Index number of @arg_ptr.*@arg_ptr: Contents of argv[@index].*@argc: Length of @argv.*@argv: Pointer to "struct tomoyo_argv".*@checked: Set to true if @argv[@index] was found.的长度加Number of "struct tomoyo_envp". moyo_envp - Check envp[] in "struct linux_binbrm".*@env_name: The name of environment variable.*@env_value: The value of environment variable.*@envc: Length of @envp.*@envp: Pointer to "struct tomoyo_envp".的长度
669  entry等于分配内存并置零
670  如果非entry则转到:out2
672  entry等于e
673  Maybe NULL. = NULL
674  condp等于entry加1
675  numbers_p等于condpNumber of conditions in this struct.
676  names_p等于numbers_pNumber of "struct tomoyo_number_union values".
677  argvmoyo_argv - Check argv[] in "struct linux_binbrm".*@index: Index number of @arg_ptr.*@arg_ptr: Contents of argv[@index].*@argc: Length of @argv.*@argv: Pointer to "struct tomoyo_argv".*@checked: Set to true if @argv[@index] was found.等于names_pNumber of "struct tomoyo_name_union names".
678  envpmoyo_envp - Check envp[] in "struct linux_binbrm".*@env_name: The name of environment variable.*@env_value: The value of environment variable.*@envc: Length of @envp.*@envp: Pointer to "struct tomoyo_envp".等于argvNumber of "struct tomoyo_argv".
680  bool flag = false
682 pos小于end_of_string循环
683  如果pos则继续下一循环
685  如果flagpos等于' '
687  否则如果*pos加1的和恒等于'='则pos等于'!'
689  否则pos等于'='
691  flag等于非flag
694  转到:rerun
695  out :
696  Define this to enable debug mode. (warning conditions "%u: %s failed\n", __LINE__, __func__)
697  如果entry
698  moyo_del_condition - Delete members in "struct tomoyo_condition".*@element: Pointer to "struct list_head".* Returns nothing.
699  释放内存
701  out2 :
702  moyo_put_name - Drop reference on "struct tomoyo_name".*@name: Pointer to "struct tomoyo_path_info". Maybe NULL.* Returns nothing.
703  返回:NULL
调用者
名称描述
tomoyo_update_domainmoyo_update_domain - Update an entry for domain policy.*@new_entry: Pointer to "struct tomoyo_acl_info".*@size: Size of @new_entry in bytes.*@param: Pointer to "struct tomoyo_acl_param".*@check_duplicate: Callback function to find duplicated entry.