Function Report

Linux Kernel (v4.4)

Source File:kernel\cred.c Create Date:2016-01-14 10:38:16
Last Modify:2016-01-11 07:01:32 Copyright©Brick
home page Tree
Annotate the kernelChinese

Function Name:copy_creds

Function:int copy_creds(struct task_struct *p, unsigned long clone_flags)

Return Type:int

Parameter:

Type Parameter NameRemarks
struct task_struct * p
unsigned long clone_flags

Function description:Copy a certificate

332  If ! keyring private to this thread && clone_flags & Same thread group then
333  objective and real subjective task credentials(COW) = Get a reference on a set of credentials
334  Get a reference on a set of credentials
335  alter_cred_subscribers( effective(overridable) subjective task credentials(COW), 2)
338  kdebug
339  increment atomic variable
340  Returning 0
343  new = Prepare a new set of credentials for modification
344  If !new then Returning -Out of memory
347  If clone_flags & New user namespace then
348  Create a new user namespace, deriving the creator from the user in the passed credentials, and replacing that user with the new root user for the new namespace.
349  If result of Create a new user namespace, deriving the creator from the user in the passed credentials, and replacing that user with the new root user for the new namespace. < 0 then Go to error_put
356  If keyring private to this thread then
357  key_put( keyring private to this thread)
358  keyring private to this thread = NULL
359  If clone_flags & Same thread group then * the userspace interface
366  If !(clone_flags & Same thread group) then
367  key_put( keyring private to this process)
368  keyring private to this process = NULL
372  increment atomic variable
373  effective(overridable) subjective task credentials(COW) = objective and real subjective task credentials(COW) = Get a reference on a set of credentials
374  alter_cred_subscribers(new, 2)
375  check for validity of credentials
376  Returning 0
378  error_put
379  Release a reference to a set of credentials
380  Returning result of Create a new user namespace, deriving the creator from the user in the passed credentials, and replacing that user with the new root user for the new namespace.
Caller
Function NameFunction description
copy_processCreate a new process