Lines Matching full:flags
67 static struct nsproxy *create_new_namespaces(unsigned long flags, in create_new_namespaces() argument
78 new_nsp->mnt_ns = copy_mnt_ns(flags, tsk->nsproxy->mnt_ns, user_ns, new_fs); in create_new_namespaces()
84 new_nsp->uts_ns = copy_utsname(flags, user_ns, tsk->nsproxy->uts_ns); in create_new_namespaces()
90 new_nsp->ipc_ns = copy_ipcs(flags, user_ns, tsk->nsproxy->ipc_ns); in create_new_namespaces()
97 copy_pid_ns(flags, user_ns, tsk->nsproxy->pid_ns_for_children); in create_new_namespaces()
103 new_nsp->cgroup_ns = copy_cgroup_ns(flags, user_ns, in create_new_namespaces()
110 new_nsp->net_ns = copy_net_ns(flags, user_ns, tsk->nsproxy->net_ns); in create_new_namespaces()
116 new_nsp->time_ns_for_children = copy_time_ns(flags, user_ns, in create_new_namespaces()
151 int copy_namespaces(unsigned long flags, struct task_struct *tsk) in copy_namespaces() argument
157 if (likely(!(flags & (CLONE_NEWNS | CLONE_NEWUTS | CLONE_NEWIPC | in copy_namespaces()
174 if ((flags & (CLONE_NEWIPC | CLONE_SYSVSEM)) == in copy_namespaces()
178 new_ns = create_new_namespaces(flags, tsk, user_ns, tsk->fs); in copy_namespaces()
257 static int check_setns_flags(unsigned long flags) in check_setns_flags() argument
259 if (!flags || (flags & ~(CLONE_NEWNS | CLONE_NEWUTS | CLONE_NEWIPC | in check_setns_flags()
265 if (flags & CLONE_NEWUSER) in check_setns_flags()
269 if (flags & CLONE_NEWPID) in check_setns_flags()
273 if (flags & CLONE_NEWUTS) in check_setns_flags()
277 if (flags & CLONE_NEWIPC) in check_setns_flags()
281 if (flags & CLONE_NEWCGROUP) in check_setns_flags()
285 if (flags & CLONE_NEWNET) in check_setns_flags()
289 if (flags & CLONE_NEWTIME) in check_setns_flags()
298 unsigned flags = nsset->flags; in put_nsset() local
300 if (flags & CLONE_NEWUSER) in put_nsset()
306 if (nsset->fs && (flags & CLONE_NEWNS) && (flags & ~CLONE_NEWNS)) in put_nsset()
312 static int prepare_nsset(unsigned flags, struct nsset *nsset) in prepare_nsset() argument
320 if (flags & CLONE_NEWUSER) in prepare_nsset()
328 if (flags == CLONE_NEWNS) { in prepare_nsset()
330 } else if (flags & CLONE_NEWNS) { in prepare_nsset()
336 nsset->flags = flags; in prepare_nsset()
359 unsigned flags = nsset->flags; in validate_nsset() local
389 if (flags & CLONE_NEWPID) { in validate_nsset()
401 if (flags & CLONE_NEWUSER) in validate_nsset()
413 if (flags & CLONE_NEWUSER) { in validate_nsset()
420 if (flags & CLONE_NEWNS) { in validate_nsset()
427 if (flags & CLONE_NEWUTS) { in validate_nsset()
435 if (flags & CLONE_NEWIPC) { in validate_nsset()
443 if (flags & CLONE_NEWPID) { in validate_nsset()
451 if (flags & CLONE_NEWCGROUP) { in validate_nsset()
459 if (flags & CLONE_NEWNET) { in validate_nsset()
467 if (flags & CLONE_NEWTIME) { in validate_nsset()
495 unsigned flags = nsset->flags; in commit_nsset() local
499 if (flags & CLONE_NEWUSER) { in commit_nsset()
507 if ((flags & CLONE_NEWNS) && (flags & ~CLONE_NEWNS)) { in commit_nsset()
513 if (flags & CLONE_NEWIPC) in commit_nsset()
518 if (flags & CLONE_NEWTIME) in commit_nsset()
527 SYSCALL_DEFINE2(setns, int, fd, int, flags) in SYSCALL_DEFINE2() argument
540 if (flags && (ns->ops->type != flags)) in SYSCALL_DEFINE2()
542 flags = ns->ops->type; in SYSCALL_DEFINE2()
544 err = check_setns_flags(flags); in SYSCALL_DEFINE2()
551 err = prepare_nsset(flags, &nsset); in SYSCALL_DEFINE2()