Lines Matching refs: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()
160 if ((flags & CLONE_VM) || in copy_namespaces()
175 if ((flags & (CLONE_NEWIPC | CLONE_SYSVSEM)) == in copy_namespaces()
179 new_ns = create_new_namespaces(flags, tsk, user_ns, tsk->fs); in copy_namespaces()
183 if ((flags & CLONE_VM) == 0) in copy_namespaces()
276 static int check_setns_flags(unsigned long flags) in check_setns_flags() argument
278 if (!flags || (flags & ~(CLONE_NEWNS | CLONE_NEWUTS | CLONE_NEWIPC | in check_setns_flags()
284 if (flags & CLONE_NEWUSER) in check_setns_flags()
288 if (flags & CLONE_NEWPID) in check_setns_flags()
292 if (flags & CLONE_NEWUTS) in check_setns_flags()
296 if (flags & CLONE_NEWIPC) in check_setns_flags()
300 if (flags & CLONE_NEWCGROUP) in check_setns_flags()
304 if (flags & CLONE_NEWNET) in check_setns_flags()
308 if (flags & CLONE_NEWTIME) in check_setns_flags()
317 unsigned flags = nsset->flags; in put_nsset() local
319 if (flags & CLONE_NEWUSER) in put_nsset()
325 if (nsset->fs && (flags & CLONE_NEWNS) && (flags & ~CLONE_NEWNS)) in put_nsset()
331 static int prepare_nsset(unsigned flags, struct nsset *nsset) in prepare_nsset() argument
339 if (flags & CLONE_NEWUSER) in prepare_nsset()
347 if (flags == CLONE_NEWNS) { in prepare_nsset()
349 } else if (flags & CLONE_NEWNS) { in prepare_nsset()
355 nsset->flags = flags; in prepare_nsset()
378 unsigned flags = nsset->flags; in validate_nsset() local
408 if (flags & CLONE_NEWPID) { in validate_nsset()
420 if (flags & CLONE_NEWUSER) in validate_nsset()
432 if (flags & CLONE_NEWUSER) { in validate_nsset()
439 if (flags & CLONE_NEWNS) { in validate_nsset()
446 if (flags & CLONE_NEWUTS) { in validate_nsset()
454 if (flags & CLONE_NEWIPC) { in validate_nsset()
462 if (flags & CLONE_NEWPID) { in validate_nsset()
470 if (flags & CLONE_NEWCGROUP) { in validate_nsset()
478 if (flags & CLONE_NEWNET) { in validate_nsset()
486 if (flags & CLONE_NEWTIME) { in validate_nsset()
514 unsigned flags = nsset->flags; in commit_nsset() local
518 if (flags & CLONE_NEWUSER) { in commit_nsset()
526 if ((flags & CLONE_NEWNS) && (flags & ~CLONE_NEWNS)) { in commit_nsset()
532 if (flags & CLONE_NEWIPC) in commit_nsset()
537 if (flags & CLONE_NEWTIME) in commit_nsset()
546 SYSCALL_DEFINE2(setns, int, fd, int, flags) in SYSCALL_DEFINE2() argument
558 if (flags && (ns->ops->type != flags)) in SYSCALL_DEFINE2()
560 flags = ns->ops->type; in SYSCALL_DEFINE2()
562 err = check_setns_flags(flags); in SYSCALL_DEFINE2()
569 err = prepare_nsset(flags, &nsset); in SYSCALL_DEFINE2()