From: Eric W. Biederman Date: Thu, 31 Jan 2013 10:09:50 +0000 (-0800) Subject: ceph: Only allow mounts in the initial network namespace X-Git-Tag: MMI-PSA29.97-13-9~14959^2~84 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eea553c21fbfa486978c82525ee8256239d4f921;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git ceph: Only allow mounts in the initial network namespace Today ceph opens tcp sockets from a delayed work callback. Delayed work happens from kernel threads which are always in the initial network namespace. Therefore fail early if someone attempts to mount a ceph filesystem from something other than the initial network namespace. Cc: Sage Weil Signed-off-by: "Eric W. Biederman" --- diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c index ee71ea26777a..1deb29af82fd 100644 --- a/net/ceph/ceph_common.c +++ b/net/ceph/ceph_common.c @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include @@ -292,6 +294,9 @@ ceph_parse_options(char *options, const char *dev_name, int err = -ENOMEM; substring_t argstr[MAX_OPT_ARGS]; + if (current->nsproxy->net_ns != &init_net) + return ERR_PTR(-EINVAL); + opt = kzalloc(sizeof(*opt), GFP_KERNEL); if (!opt) return ERR_PTR(-ENOMEM);