From 240fcd231d28c9ed115b7d40e31e265a7a446392 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Wed, 30 Jan 2013 18:50:54 -0800 Subject: [PATCH] --- yaml --- r: 357777 b: refs/heads/master c: 9fd973e085f7759f710603422b2e11ad5f2e000d h: refs/heads/master i: 357775: 9e6770cb4ee553ae91ab4bbc5e584f30dfba073a v: v3 --- [refs] | 2 +- trunk/fs/coda/inode.c | 4 ++++ trunk/fs/coda/psdev.c | 4 ++++ trunk/fs/coda/upcall.c | 4 ++-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 304697c93ce9..91c34026f8cc 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a0a5386ac6400493cc2eb8b58583e56af0708730 +refs/heads/master: 9fd973e085f7759f710603422b2e11ad5f2e000d diff --git a/trunk/fs/coda/inode.c b/trunk/fs/coda/inode.c index be2aa4909487..77bbaf4666a7 100644 --- a/trunk/fs/coda/inode.c +++ b/trunk/fs/coda/inode.c @@ -20,6 +20,7 @@ #include #include #include +#include #include @@ -157,6 +158,9 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent) int error; int idx; + if (task_active_pid_ns(current) != &init_pid_ns) + return -EINVAL; + idx = get_device_index((struct coda_mount_data *) data); /* Ignore errors in data, for backward compatibility */ diff --git a/trunk/fs/coda/psdev.c b/trunk/fs/coda/psdev.c index 761d5b31b18d..dd60f905d4fe 100644 --- a/trunk/fs/coda/psdev.c +++ b/trunk/fs/coda/psdev.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -266,6 +267,9 @@ static int coda_psdev_open(struct inode * inode, struct file * file) struct venus_comm *vcp; int idx, err; + if (task_active_pid_ns(current) != &init_pid_ns) + return -EINVAL; + idx = iminor(inode); if (idx < 0 || idx >= MAX_CODADEVS) return -ENODEV; diff --git a/trunk/fs/coda/upcall.c b/trunk/fs/coda/upcall.c index 0c68fd31fbf2..5c6d2cd6ee86 100644 --- a/trunk/fs/coda/upcall.c +++ b/trunk/fs/coda/upcall.c @@ -50,8 +50,8 @@ static void *alloc_upcall(int opcode, int size) return ERR_PTR(-ENOMEM); inp->ih.opcode = opcode; - inp->ih.pid = current->pid; - inp->ih.pgid = task_pgrp_nr(current); + inp->ih.pid = task_pid_nr_ns(current, &init_pid_ns); + inp->ih.pgid = task_pgrp_nr_ns(current, &init_pid_ns); inp->ih.uid = current_fsuid(); return (void*)inp;