函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:smack_bprm_set_creds - set creds for exec*@bprm: the exec information* Returns 0 if it gets a blob, -EPERM if exec forbidden and -ENOMEM otherwise

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

返回类型:int

参数:

类型参数名称
struct linux_binprm *bprm
906  inode等于file_inode(file)
907  bsp等于smack_cred(w credentials )
912  如果called_set_creds则返回:0
915  isp等于smack_inode(inode)
916  如果label of the task 恒等于NULLlabel of the task 恒等于 label for access control 则返回:0
919  sbsp等于s_security
920  如果smk_flags按位与SMK_SB_UNTRUSTEDlabel of the task 不等于smk_root则返回:0
924  如果how unsafe this exec is (mask of LSM_UNSAFE_*) 按位与LSM_UNSAFE_PTRACE
926  rc等于0
928  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
929  tracer等于ptrace_parent - return the task that is tracing the given task*@task: task to consider* Returns %NULL if no one is tracing @task, or the &struct task_struct* pointer to its tracer.* Must called under rcu_read_lock(). The pointer returned might be kept
930  如果此条件成立可能性大(为编译器优化)(tracer != NULL)则rc等于smk_ptrace_rule_check - helper for ptrace access*@tracer: tracer process*@tracee_known: label entry of the process that's about to be traced*@mode: ptrace attachment mode (PTRACE_MODE_*)*@func: name of the function that called us, used for audit* Returns
935  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
937  如果rc不等于0则返回:rc
940  如果how unsafe this exec is (mask of LSM_UNSAFE_*) 按位与LSM_UNSAFE_PTRACE的反则返回:负EPERM
943  label for access control 等于label of the task
944  s to clear in current->personality 或等于Security-relevant compatibility flags that must be* cleared upon setuid or setgid exec:
947  如果 label for access control 不等于 label when forked secureexec等于1
950  返回:0