Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Find a key by its serial number.

Proto:struct key *key_lookup(key_serial_t id)

Type:struct key

Parameter:

TypeParameterName
key_serial_tid
660  spin_lock( & key_serial_lock)
663  n = rb_node
664  When n cycle
665  key = rb_entry(n, structkey, serial_node)
667  If id < key serial number Then n = rb_left
669  Else if id > key serial number Then n = rb_right
671  Else Go to found
675  not_found :
676  key = ERR_PTR( - ENOKEY)
677  Go to error
679  found :
683  If Not _inc_not_zero - increment a refcount unless it is 0*@r: the refcount to increment* Similar to atomic_inc_not_zero(), but will saturate at REFCOUNT_SATURATED* and WARN.* Provides no memory ordering, it is assumed the caller has guaranteed the Then Go to not_found
686  error :
687  spin_unlock( & key_serial_lock)
688  Return key
Caller
NameDescribe
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