[CRIU] [PATCH] unix: Do not autobind unnamed unix sockets
Pavel Emelyanov
xemul at virtuozzo.com
Thu Jun 16 07:10:32 PDT 2016
On 06/15/2016 01:57 PM, Kirill Tkhai wrote:
> addlen equal to sizeof(addr.sun_family) leads
> to autobinding of socket.
>
> If it had been autobinded when we dumped it,
> name.len wouldn't have been zero. So, this
> binding is wrong. Fix that.
>
> Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
> ---
> criu/sk-unix.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/criu/sk-unix.c b/criu/sk-unix.c
> index c6cf672..9302d21 100644
> --- a/criu/sk-unix.c
> +++ b/criu/sk-unix.c
> @@ -958,7 +958,7 @@ static int bind_unix_sk(int sk, struct unix_sk_info *ui)
> if (prep_unix_sk_cwd(ui, &cwd_fd))
> return -1;
>
> - if (bind(sk, (struct sockaddr *)&addr,
> + if (ui->ue->name.len && bind(sk, (struct sockaddr *)&addr,
Few lines below there's another check for ui->ue->name.len. Would you
merge them please?
> sizeof(addr.sun_family) + ui->ue->name.len)) {
> pr_perror("Can't bind socket");
> goto done;
>
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu
> .
>
More information about the CRIU
mailing list