Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Iteration function to consider each key found.

Proto:static int keyring_search_iterator(const void *object, void *iterator_data)

Type:int

Parameter:

TypeParameterName
const void *object
void *iterator_data
580  ctx = iterator_data
581  key = keyring_ptr_to_key(object)
582  kflags = READ_ONCE( status flags (change with bitops) )
583  state = READ_ONCE( Key state (+) or rejection error (-) )
585  kenter("{%d}", key serial number )
588  If type of key != type Then
589  kleave(" = 0 [!type]")
590  Return 0
594  If flags & Override NO_STATE_CHECK Then
595  expiry = READ_ONCE( time at which key expires (or 0) )
599  result = ERR_PTR( - EKEYREVOKED)
600  kleave(" = %d [invrev]", Internal stuff )
601  Go to skipped
604  If expiry && now >= expiry Then
607  kleave(" = %d [expire]", Internal stuff )
608  Go to skipped
613  If Not cmp(key, & match_data) Then
614  kleave(" = 0 [!match]")
615  Return 0
619  If Not (flags & Don't check permissions ) && key_task_permission(make_key_ref(key, possessed), cred, Require permission to search (keyring) or find (key) ) < 0 Then
622  result = ERR_PTR( - EACCES)
623  kleave(" = %d [!perm]", Internal stuff )
624  Go to skipped
627  If flags & Override NO_STATE_CHECK Then
629  If state < 0 Then
630  result = ERR_PTR(state)
631  kleave(" = %d [neg]", Internal stuff )
632  Go to skipped
637  result = make_key_ref(key, possessed)
638  kleave(" = 1 [found]")
639  Return 1
641  skipped :
642  Return Internal stuff