From: ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org (Eric W. Biederman)
To: Vivien Chappelier
<vivien.chappelier-L+G57L1VLRbR7s880joybQ@public.gmane.org>
Cc: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org
Subject: Re: [PATCH 4/6] add SO_NSID and SO_NETNS socket options
Date: Thu, 30 Oct 2008 16:02:33 -0700 [thread overview]
Message-ID: <m1bpx1znxy.fsf@frodo.ebiederm.org> (raw)
In-Reply-To: <20081030130917.GD17665-L+G57L1VLRbR7s880joybQ@public.gmane.org> (Vivien Chappelier's message of "Thu, 30 Oct 2008 14:09:17 +0100")
> + case SO_NSID:
> + if (!capable(CAP_NET_ADMIN)) {
> + ret = -EPERM;
> + } else {
> + struct net *old_net, *new_net;
> +
> + ret = -EINVAL;
> + new_net = get_net_ns_by_id(val);
> + if (new_net) {
> + ret = 0;
> + old_net = sock_net(sk);
> + sock_net_set(sk, get_net(new_net));
> + put_net(old_net);
> + }
> + }
Ouch. This is incomplete. We can't perform this transformation on a bound socket.
And I don't see anything that would prevent that.
Eric
prev parent reply other threads:[~2008-10-30 23:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-30 13:09 [PATCH 4/6] add SO_NSID and SO_NETNS socket options Vivien Chappelier
[not found] ` <20081030130917.GD17665-L+G57L1VLRbR7s880joybQ@public.gmane.org>
2008-10-30 23:02 ` Eric W. Biederman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m1bpx1znxy.fsf@frodo.ebiederm.org \
--to=ebiederm-as9lmozglivwk0htik3j/w@public.gmane.org \
--cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
--cc=vivien.chappelier-L+G57L1VLRbR7s880joybQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.