summaryrefslogtreecommitdiffstats
path: root/fs/coda/inode.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2013-01-30 18:50:54 -0800
committerEric W. Biederman <ebiederm@xmission.com>2013-02-13 06:00:52 -0800
commit9fd973e085f7759f710603422b2e11ad5f2e000d (patch)
treeab037487925db629c9e3c5b45475f0e97954fd1d /fs/coda/inode.c
parenta0a5386ac6400493cc2eb8b58583e56af0708730 (diff)
downloadblackbird-op-linux-9fd973e085f7759f710603422b2e11ad5f2e000d.tar.gz
blackbird-op-linux-9fd973e085f7759f710603422b2e11ad5f2e000d.zip
coda: Restrict coda messages to the initial pid namespace
Remove the slight chance that pids in coda messages will be interpreted in the wrong pid namespace. - Explicitly send all pids in coda messages in the initial pid namespace. - Only allow mounts from processes in the initial pid namespace. - Only allow processes in the initial pid namespace to open the coda character device to communicate with coda. Cc: Jan Harkes <jaharkes@cs.cmu.edu> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs/coda/inode.c')
-rw-r--r--fs/coda/inode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/coda/inode.c b/fs/coda/inode.c
index be2aa4909487..77bbaf4666a7 100644
--- a/fs/coda/inode.c
+++ b/fs/coda/inode.c
@@ -20,6 +20,7 @@
#include <linux/file.h>
#include <linux/vfs.h>
#include <linux/slab.h>
+#include <linux/pid_namespace.h>
#include <asm/uaccess.h>
@@ -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 */
OpenPOWER on IntegriCloud