Skip to content

Commit

Permalink
afs: Only allow mounting afs in the intial network namespace
Browse files Browse the repository at this point in the history
rxrpc sockets only work in the initial network namespace so it isn't
possible to support afs in any other network namespace.

Cc: David Howells <dhowells@redhat.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
  • Loading branch information
Eric W. Biederman committed Feb 13, 2013
1 parent 66fdb93 commit f74f70f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/afs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <linux/parser.h>
#include <linux/statfs.h>
#include <linux/sched.h>
#include <linux/nsproxy.h>
#include <net/net_namespace.h>
#include "internal.h"

#define AFS_FS_MAGIC 0x6B414653 /* 'kAFS' */
Expand Down Expand Up @@ -363,6 +365,10 @@ static struct dentry *afs_mount(struct file_system_type *fs_type,

memset(&params, 0, sizeof(params));

ret = -EINVAL;
if (current->nsproxy->net_ns != &init_net)
goto error;

/* parse the options and device name */
if (options) {
ret = afs_parse_options(&params, options, &dev_name);
Expand Down

0 comments on commit f74f70f

Please sign in to comment.