[CRIU] [PATCH v3 2/2] unix: don't drop the path on unix sockets if they don't exist

Tycho Andersen tycho.andersen at canonical.com
Wed Jul 13 07:25:14 PDT 2016


Hi Pavel,

On Wed, Jul 13, 2016 at 04:01:59PM +0300, Pavel Emelyanov wrote:
> Both applied, thanks :)
> 
> Would you also check whether this thing git fixed:
> 
> static int bind_unix_sk(int sk, struct unix_sk_info *ui)
> {
>         struct sockaddr_un addr;
>         int cwd_fd = -1;
>         int ret = -1;
> 
>         if ((ui->ue->type == SOCK_STREAM) && (ui->ue->state == TCP_ESTABLISHED)) {
>                 /*
>                  * FIXME this can be done, but for doing this properly we
>                  * need to bind socket to its name, then rename one to
>                  * some temporary unique one and after all the sockets are
>                  * restored we should walk those temp names and rename
>                  * some of them back to real ones.
>                  */
>                 ret = 0;
>                 goto done;
>         }
> 
> this is for the case when we have established socket that inherited its name
> from the listening one. Presumably it has, and, id I'm right, would you add
> a test for this and drop this comment? :)

Won't established sockets have the same inode as listen sockets? I
think in this case we have to do something a little more clever, as
the code won't detect them as "deleted". Anyway, I can figure it out
and send some patches.

Tycho


More information about the CRIU mailing list