Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\cred.c Create Date:2022-07-28 09:32:40
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:prepare_kernel_cred - Prepare a set of credentials for a kernel service*@daemon: A userspace daemon to be used as a reference* Prepare a set of credentials for a kernel service

Proto:struct cred *prepare_kernel_cred(struct task_struct *daemon)

Type:struct cred

Parameter:

TypeParameterName
struct task_struct *daemon
686  new = kmem_cache_alloc(cred_jar, GFP_KERNEL)
687  If Not new Then Return NULL
690  kdebug("prepare_kernel_cred() alloc %p", new)
692  If daemon Then old = get_task_cred - Get another task's objective credentials*@task: The task to query* Get the objective credentials of a task, pinning them so that they can't go* away
694  Else old = get_cred - Get a reference on a set of credentials*@cred: The credentials to reference* Get a reference on the specified set of credentials. The caller must* release the reference. If %NULL is passed, it is returned with no action.
697  validate_creds(old)
699  new = old
700  Can we skip RCU deletion? = 0
701  atomic_set( & usage, 1)
702  set_cred_subscribers(new, 0)
703  get_uid( real user ID subscription )
704  get_user_ns( user_ns the caps and keyrings are relative to. )
705  get_group_info - Get a reference to a group info structure*@group_info: The group info to reference* This gets a reference to a set of supplementary groups.* If the caller is accessing a task's credentials, they must hold the RCU read* lock when reading.
708  keyring inherited over fork = NULL
709  keyring private to this process = NULL
710  keyring private to this thread = NULL
711  assumed request_key authority = NULL
712  default keyring to attach requested * keys to = KEY_REQKEY_DEFL_THREAD_KEYRING
716  subjective LSM security = NULL
718  If security_prepare_creds(new, old, GFP_KERNEL_ACCOUNT) < 0 Then Go to error
721  put_cred - Release a reference to a set of credentials*@cred: The credentials to release* Release a reference to a set of credentials, deleting them when the last ref* is released
722  validate_creds(new)
723  Return new
725  error :
726  put_cred - Release a reference to a set of credentials*@cred: The credentials to release* Release a reference to a set of credentials, deleting them when the last ref* is released
727  put_cred - Release a reference to a set of credentials*@cred: The credentials to release* Release a reference to a set of credentials, deleting them when the last ref* is released
728  Return NULL