Skip to content
Permalink
Browse files
Finish implementation of PID namespace
Change-Id: I544511e69230af6b3233e5453f3cf229bf05cd76
Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com>
  • Loading branch information
Tofee authored and bhush9 committed Oct 13, 2017
1 parent 5754614 commit bd221854de33b75db7a7fa01cb34274b62a7cbf8
Showing with 34 additions and 0 deletions.
  1. +34 −0 kernel/pid_namespace.c
@@ -250,6 +250,40 @@ int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd)
return 0;
}

static void *pidns_get(struct task_struct *task)
{
struct pid_namespace *ns;

rcu_read_lock();
ns = get_pid_ns(task_active_pid_ns(task));
rcu_read_unlock();

return ns;
}

static void pidns_put(void *ns)
{
put_pid_ns(ns);
}

static int pidns_install(struct nsproxy *nsproxy, void *ns)
{
return -EINVAL;
#ifdef notyet
put_pid_ns(nsproxy->pid_ns);
nsproxy->pid_ns = get_pid_ns(ns);
return 0;
#endif
}

const struct proc_ns_operations pidns_operations = {
.name = "pid",
.type = CLONE_NEWPID,
.get = pidns_get,
.put = pidns_put,
.install = pidns_install,
};

static __init int pid_namespaces_init(void)
{
pid_ns_cachep = KMEM_CACHE(pid_namespace, SLAB_PANIC);

0 comments on commit bd22185

Please sign in to comment.