函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\domain.c Create Date:2022-07-27 21:09:32
Last Modify:2022-05-23 20:14:46 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:moyo_find_next_domain - Find a domain.*@bprm: Pointer to "struct linux_binprm".* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock().

函数原型:int tomoyo_find_next_domain(struct linux_binprm *bprm)

返回类型:int

参数:

类型参数名称
struct linux_binprm *bprm
705  old_domain等于moyo_domain - Get "struct tomoyo_domain_info" for current thread.* Returns pointer to "struct tomoyo_domain_info" for current thread.
706  struct tomoyo_domain_info * domain = NULL
707  original_name等于Name of binary as seen by procps
708  retval等于负ENOMEM
709  bool reject_on_transition_failure = false
712  ee等于分配内存并置零
714  如果非ee则返回:负ENOMEM
716  Size is TOMOYO_EXEC_TMPSIZE bytes 等于分配内存并置零
717  如果非 Size is TOMOYO_EXEC_TMPSIZE bytes
718  释放内存
719  返回:负ENOMEM
722  tomoyo_init_request_info( & r, NULL, TOMOYO_MAC_FILE_EXECUTE)
723  For holding parameters specific to execve() request.* NULL if not dealing do_execve().等于ee
724  bprm等于bprm
725  For holding parameters specific to operations which deal files.* NULL if not dealing files.等于obj
726  First pathname. Initialized with { NULL, NULL } if no path. 等于f_path
728  retval等于负ENOENT
729  name等于tomoyo_realpath_nofollow(original_name)
730  如果非name则转到:out
732  tomoyo_fill_path_info( & exename)
733  retry :
737  list等于 List of policy. [TOMOYO_ID_AGGREGATOR]
741  candidate等于exename
744  如果rue or false or TOMOYO_GC_IN_PROGRESS 或非moyo_path_matches_pattern - Check whether the given filename matches the given pattern.*@filename: The filename to check.*@pattern: The pattern to compare.* Returns true if matches, false otherwise.* The following patterns are available.* \\ \ itself.则继续下一循环
748  candidate等于aggregated_name
749  退出
754  retval等于moyo_execute_permission - Check permission for execute operation.*@r: Pointer to "struct tomoyo_request_info".*@filename: Filename to check.* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock().
755  如果retval恒等于Retry this request. Returned by tomoyo_supervisor() if policy violation has* occurred in enforcing mode and the userspace daemon decided to retry.* We must choose a positive value in order to distinguish "granted" (which is则转到:retry
757  如果retval小于0则转到:out
765  如果 For using wildcards at tomoyo_find_next_domain(). candidate等于 For using wildcards at tomoyo_find_next_domain().
774  如果transition
775  domainname等于name
777  reject_on_transition_failure = true
778  如果非字符串比较则转到:force_keep_domain
780  如果非字符串比较则转到:force_child_domain
782  如果非字符串比较则转到:force_reset_domain
784  如果非字符串比较则转到:force_initialize_domain
786  如果非字符串比较
792  如果cpcp等于'\0'
794  否则如果domainname恒等于'<'则strncpy( Size is TOMOYO_EXEC_TMPSIZE bytes , domainname, TOMOYO_EXEC_TMPSIZE - 1)
796  否则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*@
799  转到:force_jump_domain
817  退出
823  退出
827  domain等于old_domain
828  退出
829  默认
838  domain等于old_domain
839  退出
845  退出
847  force_jump_domain :
848  如果非domaindomain等于moyo_assign_domain - Create a domain or a namespace.*@domainname: The name of domain.*@transit: True if transit to domain found or created.* Returns pointer to "struct tomoyo_domain_info" on success, NULL otherwise.* Caller holds tomoyo_read_lock().
850  如果domainretval等于0
852  否则如果reject_on_transition_failure
853  打印警告信息("ERROR: Domain '%s' not ready.\n", Size is TOMOYO_EXEC_TMPSIZE bytes )
854  retval等于负ENOMEM
855  否则如果One of tomoyo_mode_index . 恒等于TOMOYO_CONFIG_ENFORCINGretval等于负ENOMEM
857  否则
858  retval等于0
859  如果非flags[TOMOYO_DIF_TRANSITION_FAILED]则
867  out :
868  如果非domaindomain等于old_domain
872  s等于moyo_task - Get "struct tomoyo_task" for specified thread.*@task - Pointer to "struct task_struct".* Returns pointer to "struct tomoyo_task" for specified thread.
874  old_domain_info等于domain_info
875  domain_info等于domain
876  atomic_inc( & Number of referring tasks. )
878  释放内存
879  如果非retval
880  domain等于domain
881  retval等于moyo_environ - Check permission for environment variable names.*@ee: Pointer to "struct tomoyo_execve".* Returns 0 on success, negative value otherwise.
883  释放内存
884  释放内存
885  释放内存
886  返回:retval
调用者
名称描述
tomoyo_bprm_check_securitymoyo_bprm_check_security - Target for security_bprm_check().*@bprm: Pointer to "struct linux_binprm".* Returns 0 on success, negative value otherwise.