From 9fd973e085f7759f710603422b2e11ad5f2e000d Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Wed, 30 Jan 2013 18:50:54 -0800 Subject: 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 Signed-off-by: "Eric W. Biederman" --- fs/coda/psdev.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fs/coda/psdev.c') diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c index 761d5b31b18d..dd60f905d4fe 100644 --- a/fs/coda/psdev.c +++ b/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; -- cgit