Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Called from unshare. Unshare all the namespaces part of nsproxy.* On success, returns the new nsproxy.

Proto:int unshare_nsproxy_namespaces(unsigned long unshare_flags, struct nsproxy **new_nsp, struct cred *new_cred, struct fs_struct *new_fs)

Type:int

Parameter:

TypeParameterName
unsigned longunshare_flags
struct nsproxy **new_nsp
struct cred *new_cred
struct fs_struct *new_fs
192  err = 0
194  If Not (unshare_flags & ( New mount namespace group | New utsname namespace | New ipc namespace | New network namespace | New pid namespace | New cgroup namespace )) Then Return 0
198  user_ns = If new_cred Then user_ns the caps and keyrings are relative to. Else current_user_ns()
199  If Not ns_capable(user_ns, Allow setting zone reclaim policy ) Then Return -EPERM
202  new_nsp = 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.
204  If IS_ERR( * new_nsp) Then
205  err = PTR_ERR( * new_nsp)
206  Go to out
209  out :
210  Return err