Re: [PATCH 4/6] add SO_NSID and SO_NETNS socket options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +	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

_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux