Re: [PATCH] libxl: fix segfault when domain create fail

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

 



Bamvor Jian Zhang wrote:
> there is a segfault in libxl logging in libxl_ctx_free when domain
> create fail. because the log output handler vmessage is freed by
> xtl_logger_destroy before libxl_ctx_free in virDomainObjListRemove.
> move xtl_logger_destroy after libxl_ctx_free could fix this bug.
>
> Signed-off-by: Bamvor Jian Zhang <bjzhang@xxxxxxxx>
> ---
>  src/libxl/libxl_domain.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
> index 68009db..e72c483 100644
> --- a/src/libxl/libxl_domain.c
> +++ b/src/libxl/libxl_domain.c
> @@ -354,12 +354,11 @@ libxlDomainObjPrivateDispose(void *obj)
>          libxl_evdisable_domain_death(priv->ctx, priv->deathW);
>  
>      virChrdevFree(priv->devs);
> -
> -    xtl_logger_destroy(priv->logger);
> +    libxl_ctx_free(priv->ctx);
>      if (priv->logger_file)
>          VIR_FORCE_FCLOSE(priv->logger_file);
>  
> -    libxl_ctx_free(priv->ctx);
> +    xtl_logger_destroy(priv->logger);
>  }
>   

The logger is created before the ctx in libxlDomainObjPrivateInitCtx(),
and should be destroyed after the ctx.  ACK to your fix, I've pushed it.

Regards,
Jim

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]