函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\cred.c Create Date:2022-07-27 10:33:16
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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

函数原型:struct cred *prepare_kernel_cred(struct task_struct *daemon)

返回类型:struct cred

参数:

类型参数名称
struct task_struct *daemon
686  new等于kmem_cache_alloc(cred_jar, GFP_KERNEL)
687  如果非new则返回:NULL
690  kdebug("prepare_kernel_cred() alloc %p", new)
692  如果daemonold等于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  否则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(真实用户身份)
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  如果security_prepare_creds(new, old, GFP_KERNEL_ACCOUNT)小于0则转到: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  返回: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  返回:NULL
调用者
名称描述
call_usermodehelper_exec_asyncThis is the task which runs the usermode application