/kernel/time/ |
D | namespace.c | 59 static struct ucounts *inc_time_namespaces(struct user_namespace *ns) in inc_time_namespaces() argument 61 return inc_ucount(ns, current_euid(), UCOUNT_TIME_NAMESPACES); in inc_time_namespaces() 81 struct time_namespace *ns; in clone_time_ns() local 91 ns = kmalloc(sizeof(*ns), GFP_KERNEL_ACCOUNT); in clone_time_ns() 92 if (!ns) in clone_time_ns() 95 refcount_set(&ns->ns.count, 1); in clone_time_ns() 97 ns->vvar_page = alloc_page(GFP_KERNEL_ACCOUNT | __GFP_ZERO); in clone_time_ns() 98 if (!ns->vvar_page) in clone_time_ns() 101 err = ns_alloc_inum(&ns->ns); in clone_time_ns() 105 ns->ucounts = ucounts; in clone_time_ns() [all …]
|
D | sched_clock.c | 132 u64 ns; in update_sched_clock() local 138 ns = rd.epoch_ns + cyc_to_ns((cyc - rd.epoch_cyc) & rd.sched_clock_mask, rd.mult, rd.shift); in update_sched_clock() 140 rd.epoch_ns = ns; in update_sched_clock() 156 u64 res, wrap, new_mask, new_epoch, cyc, ns; in sched_clock_register() local 183 ns = rd.epoch_ns + cyc_to_ns((cyc - rd.epoch_cyc) & rd.sched_clock_mask, rd.mult, rd.shift); in sched_clock_register() 191 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/ |
D | pid_namespace.c | 61 static struct ucounts *inc_pid_namespaces(struct user_namespace *ns) in inc_pid_namespaces() argument 63 return inc_ucount(ns, current_euid(), UCOUNT_PID_NAMESPACES); in inc_pid_namespaces() 74 struct pid_namespace *ns; in create_pid_namespace() local 91 ns = kmem_cache_zalloc(pid_ns_cachep, GFP_KERNEL); in create_pid_namespace() 92 if (ns == NULL) in create_pid_namespace() 95 idr_init(&ns->idr); in create_pid_namespace() 97 ns->pid_cachep = create_pid_cachep(level); in create_pid_namespace() 98 if (ns->pid_cachep == NULL) in create_pid_namespace() 101 err = ns_alloc_inum(&ns->ns); in create_pid_namespace() 104 ns->ns.ops = &pidns_operations; 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() 36 refcount_set(&uts_ns->ns.count, 1); in create_uts_ns() 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() [all …]
|
D | user_namespace.c | 29 struct user_namespace *ns, int cap_setid, 33 static struct ucounts *inc_user_namespaces(struct user_namespace *ns, kuid_t uid) in inc_user_namespaces() argument 35 return inc_ucount(ns, uid, UCOUNT_USER_NAMESPACES); in inc_user_namespaces() 84 struct user_namespace *ns, *parent_ns = new->user_ns; in create_user_ns() local 122 ns = kmem_cache_zalloc(user_ns_cachep, GFP_KERNEL); in create_user_ns() 123 if (!ns) in create_user_ns() 126 ns->parent_could_setfcap = cap_raised(new->cap_effective, CAP_SETFCAP); in create_user_ns() 127 ret = ns_alloc_inum(&ns->ns); in create_user_ns() 130 ns->ns.ops = &userns_operations; in create_user_ns() 132 refcount_set(&ns->ns.count, 1); in create_user_ns() [all …]
|
D | ucount.c | 12 .ns = &init_user_ns, 21 #define ucounts_hashfn(ns, uid) \ argument 22 hash_long((unsigned long)__kuid_val(uid) + (unsigned long)(ns), \ 24 #define ucounts_hashentry(ns, uid) \ argument 25 (ucounts_hashtable + ucounts_hashfn(ns, uid)) 94 bool setup_userns_sysctls(struct user_namespace *ns) in setup_userns_sysctls() argument 100 setup_sysctl_set(&ns->set, &set_root, set_is_seen); in setup_userns_sysctls() 105 tbl[i].data = &ns->ucount_max[i]; in setup_userns_sysctls() 107 ns->sysctls = __register_sysctl_table(&ns->set, "user", tbl); in setup_userns_sysctls() 109 if (!ns->sysctls) { in setup_userns_sysctls() [all …]
|
D | pid.c | 58 .ns = &init_pid_ns, 76 .ns.count = REFCOUNT_INIT(2), 82 .ns.inum = PROC_PID_INIT_INO, 84 .ns.ops = &pidns_operations, 107 struct pid_namespace *ns; in put_pid() local 112 ns = pid->numbers[pid->level].ns; in put_pid() 114 kmem_cache_free(ns->pid_cachep, pid); in put_pid() 115 put_pid_ns(ns); in put_pid() 135 struct pid_namespace *ns = upid->ns; in free_pid() local 136 switch (--ns->pid_allocated) { in free_pid() [all …]
|
D | nsproxy.c | 188 void free_nsproxy(struct nsproxy *ns) in free_nsproxy() argument 190 if (ns->mnt_ns) in free_nsproxy() 191 put_mnt_ns(ns->mnt_ns); in free_nsproxy() 192 if (ns->uts_ns) in free_nsproxy() 193 put_uts_ns(ns->uts_ns); in free_nsproxy() 194 if (ns->ipc_ns) in free_nsproxy() 195 put_ipc_ns(ns->ipc_ns); in free_nsproxy() 196 if (ns->pid_ns_for_children) in free_nsproxy() 197 put_pid_ns(ns->pid_ns_for_children); in free_nsproxy() 198 if (ns->time_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() 365 static bool ns_capable_common(struct user_namespace *ns, in ns_capable_common() argument 376 capable = security_capable(current_cred(), ns, cap, opts); in ns_capable_common() 395 bool ns_capable(struct user_namespace *ns, int cap) in ns_capable() argument 397 return ns_capable_common(ns, cap, CAP_OPT_NONE); in ns_capable() 413 bool ns_capable_noaudit(struct user_namespace *ns, int cap) in ns_capable_noaudit() argument 415 return ns_capable_common(ns, cap, CAP_OPT_NOAUDIT); in ns_capable_noaudit() [all …]
|
D | acct.c | 110 struct pid_namespace *ns; member 163 static struct bsd_acct_struct *acct_get(struct pid_namespace *ns) in acct_get() argument 169 res = to_acct(READ_ONCE(ns->bacct)); in acct_get() 181 if (res != to_acct(READ_ONCE(ns->bacct))) { in acct_get() 196 cmpxchg(&acct->ns->bacct, pin, NULL); in acct_pin_kill() 216 struct pid_namespace *ns = task_active_pid_ns(current); in acct_on() local 263 acct->ns = ns; in acct_on() 271 old = xchg(&ns->bacct, &acct->pin); in acct_on() 316 void acct_exit_ns(struct pid_namespace *ns) in acct_exit_ns() argument 319 pin_kill(ns->bacct); in acct_exit_ns() [all …]
|
D | user.c | 60 .ns.count = REFCOUNT_INIT(3), 63 .ns.inum = PROC_USER_INIT_INO, 65 .ns.ops = &userns_operations,
|
D | sys.c | 369 struct user_namespace *ns = current_user_ns(); in __sys_setregid() local 375 krgid = make_kgid(ns, rgid); in __sys_setregid() 376 kegid = make_kgid(ns, egid); in __sys_setregid() 435 struct user_namespace *ns = current_user_ns(); in __sys_setgid() local 441 kgid = make_kgid(ns, gid); in __sys_setgid() 526 struct user_namespace *ns = current_user_ns(); in __sys_setreuid() local 532 kruid = make_kuid(ns, ruid); in __sys_setreuid() 533 keuid = make_kuid(ns, euid); in __sys_setreuid() 607 struct user_namespace *ns = current_user_ns(); in __sys_setuid() local 613 kuid = make_kuid(ns, uid); in __sys_setuid() [all …]
|
D | delayacct.c | 103 s64 ns = local_clock() - *start; in delayacct_end() local 106 if (ns > 0) { in delayacct_end() 108 *total += ns; in delayacct_end()
|
D | ptrace.c | 278 static bool ptrace_has_cap(struct user_namespace *ns, unsigned int mode) in ptrace_has_cap() argument 281 return ns_capable_noaudit(ns, CAP_SYS_PTRACE); in ptrace_has_cap() 282 return ns_capable(ns, CAP_SYS_PTRACE); in ptrace_has_cap()
|
D | fork.c | 1992 struct pid_namespace *ns; in pidfd_show_fdinfo() local 1996 ns = proc_pid_ns(file_inode(m->file)->i_sb); in pidfd_show_fdinfo() 1997 nr = pid_nr_ns(pid, ns); in pidfd_show_fdinfo() 2012 for (i = ns->level + 1; i <= pid->level; i++) 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() 35 refcount_set(&new_ns->ns.count, 1); 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() [all …]
|
D | cgroup-v1.c | 180 struct { enum cgroup_filetype type; struct pid_namespace *ns; } key; member 226 put_pid_ns(l->key.ns); in cgroup_pidlist_destroy_work_fn() 283 struct pid_namespace *ns = task_active_pid_ns(current); in cgroup_pidlist_find() local 288 if (l->key.type == type && l->key.ns == ns) in cgroup_pidlist_find() 318 l->key.ns = get_pid_ns(task_active_pid_ns(current)); in cgroup_pidlist_find_create() 560 if ((ctx->ns->user_ns != &init_user_ns) || in cgroup_release_agent_write() 1217 if (ctx->ns != &init_cgroup_ns) in cgroup1_root_to_use() 1242 if (!ns_capable(ctx->ns->user_ns, CAP_SYS_ADMIN)) in cgroup1_get_tree()
|
D | cgroup-internal.h | 48 struct cgroup_namespace *ns; member 70 struct cgroup_namespace *ns; member 232 struct cgroup_namespace *ns);
|
D | cgroup.c | 216 .ns.count = REFCOUNT_INIT(2), 218 .ns.ops = &cgroupns_operations, 219 .ns.inum = PROC_CGROUP_INIT_INO, 2178 if (!ret && ctx->ns != &init_cgroup_ns) { in cgroup_do_get_tree() 2186 cgrp = cset_cgroup_from_root(ctx->ns->root_cset, ctx->root); in cgroup_do_get_tree() 2216 put_cgroup_ns(ctx->ns); in cgroup_fs_context_free() 2262 ctx->ns = current->nsproxy->cgroup_ns; in cgroup_init_fs_context() 2263 get_cgroup_ns(ctx->ns); in cgroup_init_fs_context() 2270 fc->user_ns = get_user_ns(ctx->ns->user_ns); in cgroup_init_fs_context() 2360 struct cgroup_namespace *ns) in cgroup_path_ns_locked() argument [all …]
|
/kernel/bpf/ |
D | offload.c | 269 struct ns_common *ns; in bpf_prog_offload_info_fill_ns() local 279 ns = &net->ns; in bpf_prog_offload_info_fill_ns() 282 ns = NULL; in bpf_prog_offload_info_fill_ns() 288 return ns; in bpf_prog_offload_info_fill_ns() 496 struct ns_common *ns; in bpf_map_offload_info_fill_ns() local 506 ns = &net->ns; in bpf_map_offload_info_fill_ns() 509 ns = NULL; in bpf_map_offload_info_fill_ns() 515 return ns; in bpf_map_offload_info_fill_ns()
|
D | task_iter.c | 20 struct pid_namespace *ns; member 44 pid = find_pid_ns(common->pid, common->ns); in task_group_seq_get_next() 63 pid = find_pid_ns(common->pid_visiting, common->ns); in task_group_seq_get_next() 69 pid = find_pid_ns(common->pid_visiting, common->ns); in task_group_seq_get_next() 89 *tid = __task_pid_nr_ns(next_task, PIDTYPE_PID, common->ns); in task_group_seq_get_next() 120 pid = find_pid_ns(common->pid, common->ns); in task_seq_get_next() 140 pid = find_ge_pid(*tid, common->ns); in task_seq_get_next() 142 *tid = pid_nr_ns(pid, common->ns); in task_seq_get_next() 414 common->ns = get_pid_ns(task_active_pid_ns(current)); in init_seq_pidns() 425 put_pid_ns(common->ns); in fini_seq_pidns()
|
/kernel/sched/ |
D | fair.c | 1742 struct numa_stats *ns) in numa_classify() argument 1744 if ((ns->nr_running > ns->weight) && in numa_classify() 1745 (((ns->compute_capacity * 100) < (ns->util * imbalance_pct)) || in numa_classify() 1746 ((ns->compute_capacity * imbalance_pct) < (ns->runnable * 100)))) in numa_classify() 1749 if ((ns->nr_running < ns->weight) || in numa_classify() 1750 (((ns->compute_capacity * 100) > (ns->util * imbalance_pct)) && in numa_classify() 1751 ((ns->compute_capacity * imbalance_pct) > (ns->runnable * 100)))) in numa_classify() 1789 struct numa_stats *ns, int nid, in update_numa_stats() argument 1794 memset(ns, 0, sizeof(*ns)); in update_numa_stats() 1795 ns->idle_cpu = -1; in update_numa_stats() [all …]
|
D | cputime.c | 307 u64 ns; in read_sum_exec_runtime() local 312 ns = t->se.sum_exec_runtime; in read_sum_exec_runtime() 315 return ns; in read_sum_exec_runtime()
|
D | debug.c | 948 void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns, in proc_sched_show_task() argument 953 SEQ_printf(m, "%s (%d, #threads: %d)\n", p->comm, task_pid_nr_ns(p, ns), in proc_sched_show_task()
|