Function Report

Linux Kernel (v4.4)

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

Function Name:copy_namespaces

Function:int copy_namespaces(unsigned long flags, struct task_struct *tsk)

Return Type:int

Parameter:

Type Parameter NameRemarks
unsigned long flags
struct task_struct * tsk

Function description:This now handles copy for nsproxy and all namespaces therein

126  *old_ns = namespaces
127  *user_ns = task_cred_xxx
131  If Value is more likely to compile time then
132  get_nsproxy(old_ns)
133  Returning 0
136  If !ns_capable(user_ns, Allow setting zone reclaim policy) then Returning -Operation not permitted
147  If (flags & (New ipc namespace | share system V SEM_UNDO semantics)) == (New ipc namespace | share system V SEM_UNDO semantics) then Returning -Invalid argument
150  new_ns = Create new nsproxy and all of its the associated namespaces. Return the newly created nsproxy. Do not attach this to the task, leave it to the caller to do proper locking and attach it to task.
151  If IS_ERR(new_ns) then Returning PTR_ERR(new_ns)
154  namespaces = new_ns
155  Returning 0
Caller
Function NameFunction description
copy_processCreate a new process