Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:selinux_getprocattr

Proto:static int selinux_getprocattr(struct task_struct *p, char *name, char **value)

Type:int

Parameter:

TypeParameterName
struct task_struct *p
char *name
char **value
6290  _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
6291  __tsec = selinux_cred(__task_cred - Access a task's objective credentials*@task: The task to query* Access the objective credentials of a task. The caller must hold the RCU* readlock.* The result of this function should not be passed directly to get_cred();(p))
6293  If current process != p Then
6294  error = avc_has_perm - Check permissions and perform any appropriate auditing
6297  If error Then Go to bad
6301  If Not strcmp(name, "current") Then sid = current SID
6303  Else if Not strcmp(name, "prev") Then sid = SID prior to last execve
6305  Else if Not strcmp(name, "exec") Then sid = exec SID
6307  Else if Not strcmp(name, "fscreate") Then sid = fscreate SID
6309  Else if Not strcmp(name, "keycreate") Then sid = keycreate SID
6311  Else if Not strcmp(name, "sockcreate") Then sid = fscreate SID
6313  Else
6314  error = -EINVAL
6315  Go to bad
6317  _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()
6319  If Not sid Then Return 0
6322  error = security_sid_to_context( & selinux_state, sid, value, & len)
6323  If error Then Return error
6325  Return len
6327  bad :
6328  _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()
6329  Return error