Re: [PATCH kvmtool 1/9] qcow: Fix qcow1 exit fault

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

 



On Mon, 18 Feb 2019 13:06:54 +0000
Jean-Philippe Brucker <jean-philippe.brucker@xxxxxxx> wrote:

> Even though qcow1 doesn't use the refcount table, the cleanup path still
> attempts to iterate over its LRU list. Initialize the list to avoid a
> segfault on exit.

That's correct, qcow1 and qcow2 share the same qcow_disk_close() function,
which references the list.

> Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@xxxxxxx>

Reviewed-by: Andre Przywara <andre.przywara@xxxxxxx>

Cheers,
Andre.

> ---
>  disk/qcow.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/disk/qcow.c b/disk/qcow.c
> index 64cf9270a..bed70c65c 100644
> --- a/disk/qcow.c
> +++ b/disk/qcow.c
> @@ -1437,6 +1437,7 @@ static struct disk_image *qcow1_probe(int fd, bool readonly)
>  
>  	l1t->root = (struct rb_root)RB_ROOT;
>  	INIT_LIST_HEAD(&l1t->lru_list);
> +	INIT_LIST_HEAD(&q->refcount_table.lru_list);
>  
>  	h = q->header = qcow1_read_header(fd);
>  	if (!h)




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux