/kernel/ |
D | pid_namespace.c | 64 struct pid_namespace *ns = container_of(work, struct pid_namespace, proc_work); in proc_cleanup_work() local 65 pid_ns_release_proc(ns); in proc_cleanup_work() 68 static struct ucounts *inc_pid_namespaces(struct user_namespace *ns) in inc_pid_namespaces() argument 70 return inc_ucount(ns, current_euid(), UCOUNT_PID_NAMESPACES); in inc_pid_namespaces() 81 struct pid_namespace *ns; in create_pid_namespace() local 98 ns = kmem_cache_zalloc(pid_ns_cachep, GFP_KERNEL); in create_pid_namespace() 99 if (ns == NULL) in create_pid_namespace() 102 idr_init(&ns->idr); in create_pid_namespace() 104 ns->pid_cachep = create_pid_cachep(level); in create_pid_namespace() 105 if (ns->pid_cachep == NULL) in create_pid_namespace() [all …]
|
D | utsname.c | 20 static struct ucounts *inc_uts_namespaces(struct user_namespace *ns) in inc_uts_namespaces() argument 22 return inc_ucount(ns, current_euid(), UCOUNT_UTS_NAMESPACES); in inc_uts_namespaces() 48 struct uts_namespace *ns; in clone_uts_ns() local 58 ns = create_uts_ns(); in clone_uts_ns() 59 if (!ns) in clone_uts_ns() 62 err = ns_alloc_inum(&ns->ns); in clone_uts_ns() 66 ns->ucounts = ucounts; in clone_uts_ns() 67 ns->ns.ops = &utsns_operations; in clone_uts_ns() 70 memcpy(&ns->name, &old_ns->name, sizeof(ns->name)); in clone_uts_ns() 71 ns->user_ns = get_user_ns(user_ns); in clone_uts_ns() [all …]
|
D | user_namespace.c | 28 struct user_namespace *ns, int cap_setid, 32 static struct ucounts *inc_user_namespaces(struct user_namespace *ns, kuid_t uid) in inc_user_namespaces() argument 34 return inc_ucount(ns, uid, UCOUNT_USER_NAMESPACES); in inc_user_namespaces() 71 struct user_namespace *ns, *parent_ns = new->user_ns; in create_user_ns() local 105 ns = kmem_cache_zalloc(user_ns_cachep, GFP_KERNEL); in create_user_ns() 106 if (!ns) in create_user_ns() 109 ret = ns_alloc_inum(&ns->ns); in create_user_ns() 112 ns->ns.ops = &userns_operations; in create_user_ns() 114 atomic_set(&ns->count, 1); in create_user_ns() 116 ns->parent = parent_ns; in create_user_ns() [all …]
|
D | pid.c | 56 .ns = &init_pid_ns, 80 .ns.inum = PROC_PID_INIT_INO, 82 .ns.ops = &pidns_operations, 105 struct pid_namespace *ns; in put_pid() local 110 ns = pid->numbers[pid->level].ns; in put_pid() 112 kmem_cache_free(ns->pid_cachep, pid); in put_pid() 113 put_pid_ns(ns); in put_pid() 133 struct pid_namespace *ns = upid->ns; in free_pid() local 134 switch (--ns->pid_allocated) { in free_pid() 141 wake_up_process(ns->child_reaper); in free_pid() [all …]
|
D | ucount.c | 15 #define ucounts_hashfn(ns, uid) \ argument 16 hash_long((unsigned long)__kuid_val(uid) + (unsigned long)(ns), \ 18 #define ucounts_hashentry(ns, uid) \ argument 19 (ucounts_hashtable + ucounts_hashfn(ns, uid)) 80 bool setup_userns_sysctls(struct user_namespace *ns) in setup_userns_sysctls() argument 84 setup_sysctl_set(&ns->set, &set_root, set_is_seen); in setup_userns_sysctls() 89 tbl[i].data = &ns->ucount_max[i]; in setup_userns_sysctls() 91 ns->sysctls = __register_sysctl_table(&ns->set, "user", tbl); in setup_userns_sysctls() 93 if (!ns->sysctls) { in setup_userns_sysctls() 95 retire_sysctl_set(&ns->set); in setup_userns_sysctls() [all …]
|
D | nsproxy.c | 169 void free_nsproxy(struct nsproxy *ns) in free_nsproxy() argument 171 if (ns->mnt_ns) in free_nsproxy() 172 put_mnt_ns(ns->mnt_ns); in free_nsproxy() 173 if (ns->uts_ns) in free_nsproxy() 174 put_uts_ns(ns->uts_ns); in free_nsproxy() 175 if (ns->ipc_ns) in free_nsproxy() 176 put_ipc_ns(ns->ipc_ns); in free_nsproxy() 177 if (ns->pid_ns_for_children) in free_nsproxy() 178 put_pid_ns(ns->pid_ns_for_children); in free_nsproxy() 179 put_cgroup_ns(ns->cgroup_ns); in free_nsproxy() [all …]
|
D | capability.c | 295 struct user_namespace *ns, int cap) in has_ns_capability() argument 300 ret = security_capable(__task_cred(t), ns, cap, CAP_OPT_NONE); in has_ns_capability() 336 struct user_namespace *ns, int cap) in has_ns_capability_noaudit() argument 341 ret = security_capable(__task_cred(t), ns, cap, CAP_OPT_NOAUDIT); in has_ns_capability_noaudit() 364 static bool ns_capable_common(struct user_namespace *ns, in ns_capable_common() argument 375 capable = security_capable(current_cred(), ns, cap, opts); in ns_capable_common() 394 bool ns_capable(struct user_namespace *ns, int cap) in ns_capable() argument 396 return ns_capable_common(ns, cap, CAP_OPT_NONE); in ns_capable() 412 bool ns_capable_noaudit(struct user_namespace *ns, int cap) in ns_capable_noaudit() argument 414 return ns_capable_common(ns, cap, CAP_OPT_NOAUDIT); in ns_capable_noaudit() [all …]
|
D | acct.c | 91 struct pid_namespace *ns; member 144 static struct bsd_acct_struct *acct_get(struct pid_namespace *ns) in acct_get() argument 150 res = to_acct(READ_ONCE(ns->bacct)); in acct_get() 162 if (res != to_acct(READ_ONCE(ns->bacct))) { in acct_get() 177 cmpxchg(&acct->ns->bacct, pin, NULL); in acct_pin_kill() 197 struct pid_namespace *ns = task_active_pid_ns(current); in acct_on() local 244 acct->ns = ns; in acct_on() 252 old = xchg(&ns->bacct, &acct->pin); in acct_on() 297 void acct_exit_ns(struct pid_namespace *ns) in acct_exit_ns() argument 300 pin_kill(ns->bacct); in acct_exit_ns() [all …]
|
D | delayacct.c | 48 s64 ns = ktime_get_ns() - *start; in delayacct_end() local 51 if (ns > 0) { in delayacct_end() 53 *total += ns; in delayacct_end()
|
D | sys.c | 354 struct user_namespace *ns = current_user_ns(); in __sys_setregid() local 360 krgid = make_kgid(ns, rgid); in __sys_setregid() 361 kegid = make_kgid(ns, egid); in __sys_setregid() 416 struct user_namespace *ns = current_user_ns(); in __sys_setgid() local 422 kgid = make_kgid(ns, gid); in __sys_setgid() 497 struct user_namespace *ns = current_user_ns(); in __sys_setreuid() local 503 kruid = make_kuid(ns, ruid); in __sys_setreuid() 504 keuid = make_kuid(ns, euid); in __sys_setreuid() 573 struct user_namespace *ns = current_user_ns(); in __sys_setuid() local 579 kuid = make_kuid(ns, uid); in __sys_setuid() [all …]
|
D | user.c | 62 .ns.inum = PROC_USER_INIT_INO, 64 .ns.ops = &userns_operations,
|
D | ptrace.c | 267 static bool ptrace_has_cap(const struct cred *cred, struct user_namespace *ns, in ptrace_has_cap() argument 273 ret = security_capable(cred, ns, CAP_SYS_PTRACE, CAP_OPT_NOAUDIT); in ptrace_has_cap() 275 ret = security_capable(cred, ns, CAP_SYS_PTRACE, CAP_OPT_NONE); in ptrace_has_cap()
|
D | fork.c | 1707 struct pid_namespace *ns = proc_pid_ns(file_inode(m->file)); in pidfd_show_fdinfo() local 1710 seq_put_decimal_ull(m, "Pid:\t", pid_nr_ns(pid, ns)); in pidfd_show_fdinfo()
|
/kernel/cgroup/ |
D | namespace.c | 12 static struct ucounts *inc_cgroup_namespaces(struct user_namespace *ns) in inc_cgroup_namespaces() argument 14 return inc_ucount(ns, current_euid(), UCOUNT_CGROUP_NAMESPACES); in inc_cgroup_namespaces() 30 ret = ns_alloc_inum(&new_ns->ns); in alloc_cgroup_ns() 36 new_ns->ns.ops = &cgroupns_operations; in alloc_cgroup_ns() 40 void free_cgroup_ns(struct cgroup_namespace *ns) in free_cgroup_ns() argument 42 put_css_set(ns->root_cset); in free_cgroup_ns() 43 dec_cgroup_namespaces(ns->ucounts); in free_cgroup_ns() 44 put_user_ns(ns->user_ns); in free_cgroup_ns() 45 ns_free_inum(&ns->ns); in free_cgroup_ns() 46 kfree(ns); in free_cgroup_ns() [all …]
|
D | cgroup-v1.c | 183 struct { enum cgroup_filetype type; struct pid_namespace *ns; } key; member 229 put_pid_ns(l->key.ns); in cgroup_pidlist_destroy_work_fn() 286 struct pid_namespace *ns = task_active_pid_ns(current); in cgroup_pidlist_find() local 291 if (l->key.type == type && l->key.ns == ns) in cgroup_pidlist_find() 321 l->key.ns = get_pid_ns(task_active_pid_ns(current)); in cgroup_pidlist_find_create() 1186 if (ctx->ns != &init_cgroup_ns) in cgroup1_root_to_use() 1208 if (!ns_capable(ctx->ns->user_ns, CAP_SYS_ADMIN)) in cgroup1_get_tree()
|
D | cgroup-internal.h | 49 struct cgroup_namespace *ns; member 216 struct cgroup_namespace *ns);
|
D | cgroup.c | 208 .ns.ops = &cgroupns_operations, 209 .ns.inum = PROC_CGROUP_INIT_INO, 2107 if (!ret && ctx->ns != &init_cgroup_ns) { in cgroup_do_get_tree() 2115 cgrp = cset_cgroup_from_root(ctx->ns->root_cset, ctx->root); in cgroup_do_get_tree() 2145 put_cgroup_ns(ctx->ns); in cgroup_fs_context_free() 2198 ctx->ns = current->nsproxy->cgroup_ns; in cgroup_init_fs_context() 2199 get_cgroup_ns(ctx->ns); in cgroup_init_fs_context() 2206 fc->user_ns = get_user_ns(ctx->ns->user_ns); in cgroup_init_fs_context() 2291 struct cgroup_namespace *ns) in cgroup_path_ns_locked() argument 2293 struct cgroup *root = cset_cgroup_from_root(ns->root_cset, cgrp->root); in cgroup_path_ns_locked() [all …]
|
/kernel/time/ |
D | sched_clock.c | 145 u64 ns; in update_sched_clock() local 151 ns = rd.epoch_ns + cyc_to_ns((cyc - rd.epoch_cyc) & rd.sched_clock_mask, rd.mult, rd.shift); in update_sched_clock() 153 rd.epoch_ns = ns; in update_sched_clock() 170 u64 res, wrap, new_mask, new_epoch, cyc, ns; in sched_clock_register() local 196 ns = rd.epoch_ns + cyc_to_ns((cyc - rd.epoch_cyc) & rd.sched_clock_mask, rd.mult, rd.shift); in sched_clock_register() 204 rd.epoch_ns = ns; in sched_clock_register()
|
D | timecounter.c | 72 u64 ns = (u64) cycles; in cc_cyc2ns_backwards() local 74 ns = ((ns * cc->mult) - frac) >> cc->shift; in cc_cyc2ns_backwards() 76 return ns; in cc_cyc2ns_backwards()
|
/kernel/bpf/ |
D | offload.c | 272 struct ns_common *ns; in bpf_prog_offload_info_fill_ns() local 282 ns = &net->ns; in bpf_prog_offload_info_fill_ns() 285 ns = NULL; in bpf_prog_offload_info_fill_ns() 291 return ns; in bpf_prog_offload_info_fill_ns() 499 struct ns_common *ns; in bpf_map_offload_info_fill_ns() local 509 ns = &net->ns; in bpf_map_offload_info_fill_ns() 512 ns = NULL; in bpf_map_offload_info_fill_ns() 518 return ns; in bpf_map_offload_info_fill_ns()
|
/kernel/sched/ |
D | cputime.c | 284 u64 ns; in read_sum_exec_runtime() local 289 ns = t->se.sum_exec_runtime; in read_sum_exec_runtime() 292 return ns; in read_sum_exec_runtime()
|
D | debug.c | 856 void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns, in proc_sched_show_task() argument 861 SEQ_printf(m, "%s (%d, #threads: %d)\n", p->comm, task_pid_nr_ns(p, ns), in proc_sched_show_task()
|
D | fair.c | 1490 static void update_numa_stats(struct numa_stats *ns, int nid) in update_numa_stats() argument 1494 memset(ns, 0, sizeof(*ns)); in update_numa_stats() 1498 ns->load += cpu_runnable_load(rq); in update_numa_stats() 1499 ns->compute_capacity += capacity_of(cpu); in update_numa_stats()
|
D | core.c | 3551 u64 ns; in task_sched_runtime() local 3580 ns = p->se.sum_exec_runtime; in task_sched_runtime() 3583 return ns; in task_sched_runtime()
|
/kernel/events/ |
D | core.c | 1330 nr = __task_pid_nr_ns(p, type, event->ns); in perf_event_pid_type() 4324 if (event->ns) in free_event_rcu() 4325 put_pid_ns(event->ns); in free_event_rcu() 10470 event->ns = get_pid_ns(task_active_pid_ns(current)); in perf_event_alloc() 10633 if (event->ns) in perf_event_alloc() 10634 put_pid_ns(event->ns); in perf_event_alloc()
|