函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\keyctl.c Create Date:2022-07-27 19:55:37
Last Modify:2020-03-18 07:59:52 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Attempt to install the calling process's session keyring on the process's* parent process.* The keyring must exist and must grant the caller LINK permission, and the* parent process must be single-threaded and must have the same effective

函数原型:long keyctl_session_to_parent(void)

返回类型:long

参数:

1559  keyring_r等于Look up a key ID given us by userspace with a given permissions mask to get* the key it refers to.* Flags can be passed to request that special keyrings be created if referred* to directly, to permit partially constructed keys to be found and to skip
1560  如果是错误则返回:错误
1563  ret等于负ENOMEM
1568  cred等于Allocate blank credentials, such that the credentials can be filled in at a* later date without risk of ENOMEM.
1569  如果非cred则转到:error_keyring
1571  newwork等于删除RCU锁
1573  keyring inherited over fork 等于key_ref_to_ptr(keyring_r)
1574  keyring_r = NULL
1575  init_task_work(newwork, key_change_session_keyring)
1577  me等于当前进程
1578  _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
1579  write_lock_irq( & tasklist_lock)
1581  ret等于负EPERM
1582  oldwork = NULL
1583  parent等于cu_dereference_protected() - fetch RCU pointer when updates prevented*@p: The pointer to read, prior to dereferencing*@c: The conditions under which the dereference will take place* Return the value of the specified RCU-protected pointer, but omit(real_parent, lockdep_is_held( & tasklist_lock))
1587  如果pid小于等于1或非mm则转到:unlock
1591  如果非thread_group_empty(parent)则转到:unlock
1596  mycred等于current_cred - Access the current task's subjective credentials* Access the subjective credentials of the current task. RCU-safe,* since nobody else can modify it.()
1597  pcred等于__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();(parent)
1598  如果mycred恒等于pcred keyring inherited over fork 恒等于 keyring inherited over fork
1600  ret等于0
1601  转到:unlock
1606  如果非uid_eq(进程uid, 有效uid)或非uid_eq(有效uid, 有效uid)或非uid_eq(保留uid, 有效uid)或非gid_eq(进程gid, 有效gid)或非gid_eq(有效gid, 有效gid)或非gid_eq(保留gid, 有效gid)则转到:unlock
1615  如果 keyring inherited over fork 且非uid_eq(uid, 有效uid)或非uid_eq(uid, 有效uid)则转到:unlock
1621  oldwork等于ask_work_cancel - cancel a pending work added by task_work_add()*@task: the task which should execute the work*@func: identifies the work to remove* Find the last queued pending work with ->func == @func and remove* it from queue.* RETURNS:
1625  ret等于ask_work_add - ask the @task to execute @work->func()*@task: the task which should run the callback*@work: the callback to run*@notify: send the notification if true* Queue @work for task_work_run() below and notify the @task if @notify.
1626  如果非retnewwork = NULL
1628  unlock :
1629  write_unlock_irq( & tasklist_lock)
1630  _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()
1631  如果oldworkput_cred - Release a reference to a set of credentials*@cred: The credentials to release* Release a reference to a set of credentials, deleting them when the last ref* is released
1633  如果newworkput_cred - Release a reference to a set of credentials*@cred: The credentials to release* Release a reference to a set of credentials, deleting them when the last ref* is released
1635  返回:ret
1637  error_keyring :
1638  key_ref_put(keyring_r)
1639  返回:ret
调用者
名称描述
SYSCALL_DEFINE5The key control system call
COMPAT_SYSCALL_DEFINE5The key control system call, 32-bit compatibility version for 64-bit archs