Re: [PATCH 1/3] Make sockets proper objhash objects and use checkpoint_obj() on them (v2)

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

 



Quoting Dan Smith (danms@xxxxxxxxxx):
> +static int do_sock_checkpoint(struct ckpt_ctx *ctx, struct sock *sk)
> +{
> +	struct socket *sock;
> +	int ret;
> +
> +	if (sk->sk_socket)
> +		return __do_sock_checkpoint(ctx, sk);
> +
> +	/* Temporarily adopt this orphan socket */
> +	ret = sock_create(sk->sk_family, sk->sk_type, 0, &sock);
> +	if (ret < 0)
> +		return ret;
> +	sock_graft(sk, sock);
> +
> +	ret = __do_sock_checkpoint(ctx, sk);

I'm sure I sound like an idiot, but... at restore, a socket will
be created for sk now.  Is that a problem?  I don't see where
sk_free() will cause that sock to be freed, and you are not
attaching it do a file whose close would cause it to be released...

-serge
_______________________________________________
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