函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Join the named keyring as the session keyring if possible else attempt to* create a new one of that name and join that

函数原型:long join_session_keyring(const char *name)

返回类型:long

参数:

类型参数名称
const char *name
845  new等于prepare_creds - Prepare a new set of credentials for modification* Prepare a new set of task credentials for modification
846  如果非new则返回:负ENOMEM
848  old等于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.()
851  如果非name
852  ret等于Install the given keyring as the session keyring of the given credentials* struct, replacing the existing one if any. If the given keyring is NULL,* then install a new anonymous session keyring.*@cred can not be in use by any task yet.
853  如果ret小于0则转到:error
856  serial等于 key serial number
857  ret等于mmit_creds - Install new credentials upon the current task*@new: The credentials to be assigned* Install a new set of credentials to the current task, using RCU to replace* the old set. Both the objective and the subjective credentials pointers are
858  如果ret恒等于0则ret等于serial
860  转到:okay
864  mutex_lock( & Session keyring create vs join semaphore )
867  keyring等于Find a keyring with the specified name
868  如果错误恒等于负ENOKEY
870  keyring等于Allocate a keyring and link into the destination keyring.
874  如果是错误
875  ret等于错误
876  转到:error2
878  否则如果是错误
879  ret等于错误
880  转到:error2
881  否则如果keyring恒等于 keyring inherited over fork
882  ret等于0
883  转到:error3
887  ret等于Install the given keyring as the session keyring of the given credentials* struct, replacing the existing one if any. If the given keyring is NULL,* then install a new anonymous session keyring.*@cred can not be in use by any task yet.
888  如果ret小于0则转到:error3
891  mmit_creds - Install new credentials upon the current task*@new: The credentials to be assigned* Install a new set of credentials to the current task, using RCU to replace* the old set. Both the objective and the subjective credentials pointers are
892  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
894  ret等于 key serial number
895  key_put - Discard a reference to a key.*@key: The key to discard a reference from.* Discard a reference to a key, and when all the references are gone, we* schedule the cleanup task to come and pull it out of the tree in process
896  okay :
897  返回:ret
899  error3 :
900  key_put - Discard a reference to a key.*@key: The key to discard a reference from.* Discard a reference to a key, and when all the references are gone, we* schedule the cleanup task to come and pull it out of the tree in process
901  error2 :
902  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
903  error :
904  abort_creds - Discard a set of credentials and unlock the current task*@new: The credentials that were going to be applied* Discard a set of credentials that were under construction and unlock the* current task.
905  返回:ret
调用者
名称描述
lookup_user_keyLook 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
keyctl_join_session_keyringJoin a (named) session keyring.* Create and join an anonymous session keyring or join a named session* keyring, creating it if necessary. A named session keyring must have Search* permission for it to be joined. Session keyrings without this permit will