linux/kernel/pid_namespace.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Pid namespaces
 *
 * Authors:
 *    (C) 2007 Pavel Emelyanov <[email protected]>, OpenVZ, SWsoft Inc.
 *    (C) 2007 Sukadev Bhattiprolu <[email protected]>, IBM
 *     Many thanks to Oleg Nesterov for comments and help
 *
 */

#include <linux/pid.h>
#include <linux/pid_namespace.h>
#include <linux/user_namespace.h>
#include <linux/syscalls.h>
#include <linux/cred.h>
#include <linux/err.h>
#include <linux/acct.h>
#include <linux/slab.h>
#include <linux/proc_ns.h>
#include <linux/reboot.h>
#include <linux/export.h>
#include <linux/sched/task.h>
#include <linux/sched/signal.h>
#include <linux/idr.h>
#include <uapi/linux/wait.h>
#include "pid_sysctl.h"

static DEFINE_MUTEX(pid_caches_mutex);
static struct kmem_cache *pid_ns_cachep;
/* Write once array, filled from the beginning. */
static struct kmem_cache *pid_cache[MAX_PID_NS_LEVEL];

/*
 * creates the kmem cache to allocate pids from.
 * @level: pid namespace level
 */

static struct kmem_cache *create_pid_cachep(unsigned int level)
{}

static struct ucounts *inc_pid_namespaces(struct user_namespace *ns)
{}

static void dec_pid_namespaces(struct ucounts *ucounts)
{}

static struct pid_namespace *create_pid_namespace(struct user_namespace *user_ns,
	struct pid_namespace *parent_pid_ns)
{}

static void delayed_free_pidns(struct rcu_head *p)
{}

static void destroy_pid_namespace(struct pid_namespace *ns)
{}

struct pid_namespace *copy_pid_ns(unsigned long flags,
	struct user_namespace *user_ns, struct pid_namespace *old_ns)
{}

void put_pid_ns(struct pid_namespace *ns)
{}
EXPORT_SYMBOL_GPL();

void zap_pid_ns_processes(struct pid_namespace *pid_ns)
{}

#ifdef CONFIG_CHECKPOINT_RESTORE
static int pid_ns_ctl_handler(const struct ctl_table *table, int write,
		void *buffer, size_t *lenp, loff_t *ppos)
{}

extern int pid_max;
static struct ctl_table pid_ns_ctl_table[] =;
#endif	/* CONFIG_CHECKPOINT_RESTORE */

int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd)
{}

static inline struct pid_namespace *to_pid_ns(struct ns_common *ns)
{}

static struct ns_common *pidns_get(struct task_struct *task)
{}

static struct ns_common *pidns_for_children_get(struct task_struct *task)
{}

static void pidns_put(struct ns_common *ns)
{}

static int pidns_install(struct nsset *nsset, struct ns_common *ns)
{}

static struct ns_common *pidns_get_parent(struct ns_common *ns)
{}

static struct user_namespace *pidns_owner(struct ns_common *ns)
{}

const struct proc_ns_operations pidns_operations =;

const struct proc_ns_operations pidns_for_children_operations =;

static __init int pid_namespaces_init(void)
{}

__initcall(pid_namespaces_init);