Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:key_reject_and_link - Negatively instantiate a key and link it into the keyring.*@key: The key to instantiate.*@timeout: The timeout on the negative key.*@error: The error to return when the key is hit.

Proto:int key_reject_and_link(struct key *key, unsigned timeout, unsigned error, struct key *keyring, struct key *authkey)

Type:int

Parameter:

TypeParameterName
struct key *key
unsignedtimeout
unsignederror
struct key *keyring
struct key *authkey
575  struct assoc_array_edit * edit = NULL
576  link_ret = 0
578  key_check(key)
579  key_check(keyring)
581  awaken = 0
582  ret = -EBUSY
584  If keyring Then
585  If This is set on a keyring to restrict the addition of a link to a key * to it. If this structure isn't provided then it is assumed that the * keyring is open to any addition. It is ignored for non-keyring * keys. Only set this value using keyring_restrict( Then Return -EPERM
588  link_ret = __key_link_lock(keyring, & index_key)
589  If link_ret == 0 Then
596  mutex_lock( & We serialise key instantiation and link )
599  If Key state (+) or rejection error (-) == KEY_IS_UNINSTANTIATED Then
601  atomic_inc( & nikeys)
602  Change the key state to being instantiated.
603  time at which key expires (or 0) = ktime_get_real_seconds - Get the seconds portion of CLOCK_REALTIME* Returns the wall clock seconds since 1970. This replaces the* get_seconds() interface which is not y2038 safe on 32bit systems. + timeout
604  Schedule a garbage collection run.* - time precision isn't particularly important
606  If st_and_clear_bit - Clear a bit and return its old value*@nr: Bit to clear*@addr: Address to count from* This is an atomic fully-ordered operation (implied full memory barrier). Then awaken = 1
609  ret = 0
612  If keyring && link_ret == 0 Then __key_link(key, & edit)
616  If authkey Then key_invalidate - Invalidate a key.*@key: The key to be invalidated.* Mark a key as being invalidated and have it cleaned up immediately. The key* is ignored by all searches and other operations from this point.
620  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.
622  If keyring && link_ret == 0 Then Finish linking a key into to a keyring.* Must be called with __key_link_begin() having being called.
626  If awaken Then wake_up_bit - wake up a waiter on a bit*@word: the word being waited on, a kernel virtual address*@bit: the bit of the word being waited on* There is a standard hashed waitqueue table for generic use
629  Return If ret == 0 Then link_ret Else ret
Caller
NameDescribe
keyctl_reject_keyNegatively instantiate the key with the given timeout (in seconds) and error* code and link the key into the destination keyring if one is given.* The caller must have the appropriate instantiation permit set for this to
key_negate_and_link