diff options
Diffstat (limited to 'fs/coda/psdev.c')
-rw-r--r-- | fs/coda/psdev.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c index 761d5b31b18d..ebc2bae6c289 100644 --- a/fs/coda/psdev.c +++ b/fs/coda/psdev.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/list.h> | 37 | #include <linux/list.h> |
38 | #include <linux/mutex.h> | 38 | #include <linux/mutex.h> |
39 | #include <linux/device.h> | 39 | #include <linux/device.h> |
40 | #include <linux/pid_namespace.h> | ||
40 | #include <asm/io.h> | 41 | #include <asm/io.h> |
41 | #include <asm/poll.h> | 42 | #include <asm/poll.h> |
42 | #include <asm/uaccess.h> | 43 | #include <asm/uaccess.h> |
@@ -266,6 +267,12 @@ static int coda_psdev_open(struct inode * inode, struct file * file) | |||
266 | struct venus_comm *vcp; | 267 | struct venus_comm *vcp; |
267 | int idx, err; | 268 | int idx, err; |
268 | 269 | ||
270 | if (task_active_pid_ns(current) != &init_pid_ns) | ||
271 | return -EINVAL; | ||
272 | |||
273 | if (current_user_ns() != &init_user_ns) | ||
274 | return -EINVAL; | ||
275 | |||
269 | idx = iminor(inode); | 276 | idx = iminor(inode); |
270 | if (idx < 0 || idx >= MAX_CODADEVS) | 277 | if (idx < 0 || idx >= MAX_CODADEVS) |
271 | return -ENODEV; | 278 | return -ENODEV; |