[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] hostmem: fix crash when querying empty host-
From: |
Stefano Garzarella |
Subject: |
Re: [Qemu-devel] [PATCH v2] hostmem: fix crash when querying empty host-nodes property via QMP |
Date: |
Fri, 15 Feb 2019 10:02:55 +0100 |
User-agent: |
NeoMutt/20180716 |
On Thu, Feb 14, 2019 at 05:57:33AM -0500, Igor Mammedov wrote:
> QEMU will crashes with
> qapi/qobject-output-visitor.c:210: qobject_output_complete: Assertion
> `qov->root && ((&qov->stack)->slh_first == ((void *)0))' failed
> when trying to get value of not set hostmem's "host-nodes"
> property, HostMemoryBackend::host_nodes bitmap doesn't have
> any bits set in it, which leads to find_first_bit() returning
> MAX_NODES and consequently to an early return from
> host_memory_backend_get_host_nodes() without calling visitor.
>
> Fix it by calling visitor even if "host-nodes" property wasn't
> set before exiting from property getter to return valid empty
> list.
>
> Signed-off-by: Igor Mammedov <address@hidden>
> ---
> v2:
> * fixup commit message to put emphasis on property instead
> local variable host_nodes and make explanation more hopefully
> more clear. (Markus Armbruster <address@hidden>)
> ---
> backends/hostmem.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Reviewed-by: Stefano Garzarella <address@hidden>