#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;
static struct kmem_cache *pid_cache[MAX_PID_NS_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
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);