Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\process_keys.c Create Date:2022-07-28 18:22:16
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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.

Proto:int install_session_keyring_to_cred(struct cred *cred, struct key *keyring)

Type:int

Parameter:

TypeParameterName
struct cred *cred
struct key *keyring
322  might_sleep()
325  If Not keyring Then
326  flags = add to quota, permit even if overrun
327  If keyring inherited over fork Then flags = add to quota, reject if would overrun
330  keyring = Allocate a keyring and link into the destination keyring.
333  If IS_ERR(keyring) Then Return PTR_ERR(keyring)
335  Else
336  __key_get(keyring)
340  old = keyring inherited over fork
341  keyring inherited over fork = keyring
343  If old Then 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
346  Return 0
Caller
NameDescribe
install_session_keyringInstall the given keyring as the session keyring of the current task,* replacing the existing one if any. If the given keyring is NULL, then* install a new anonymous session keyring.* Return: 0 on success; -errno on failure.
join_session_keyringJoin the named keyring as the session keyring if possible else attempt to* create a new one of that name and join that
umh_keys_initInitialise a usermode helper that is going to have a specific session* keyring.* This is called in context of freshly forked kthread before kernel_execve(),* so we can simply install the desired session_keyring at this point.