<feed xmlns='http://www.w3.org/2005/Atom'>
<title>qemu/qemu.git/backends/rng.c, branch master</title>
<subtitle>QEMU main repository</subtitle>
<id>https://git.landau.one/pub/scm/virt/qemu/qemu.git/atom?h=master</id>
<link rel='self' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/'/>
<updated>2026-07-27T19:14:13+00:00</updated>
<entry>
<title>backends/rng: cap request size to avoid oversized allocation</title>
<updated>2026-07-27T19:14:13+00:00</updated>
<author>
<name>Laurent Vivier</name>
<email>lvivier@redhat.com</email>
</author>
<published>2026-07-15T14:13:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=70074cc48f450e6c95881ac534e67013c8773cb2'/>
<id>urn:sha1:70074cc48f450e6c95881ac534e67013c8773cb2</id>
<content type='text'>
rng_backend_request_entropy() uses the requested size to allocate
a buffer with g_malloc(). With virtio-rng, this size comes from
guest-supplied descriptor lengths. A malicious guest can set a very
large descriptor length, causing QEMU to attempt a multi-gigabyte
allocation and abort.

Cap the allocation to 64 KiB. The virtio-rng queue size is
hardcoded to 8 entries, the EGD backend protocol limits requests
to 255 bytes, the Linux kernel hwrng framework requests at most
SMP_CACHE_BYTES per call (64 bytes on x86_64), and the Windows
viorng driver uses a 4 KiB buffer. The worst legitimate case is
8 x 4 KiB = 32 KiB, so 64 KiB is well above any legitimate use.

Fixes: 14417039653d ("virtio-rng: use virtqueue_get_avail_bytes, fix migration")
Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3983
Reported-by: dong ling &lt;dongling226655@outlook.com&gt;
Signed-off-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Reviewed-by: Thomas Huth &lt;thuth@redhat.com&gt;
Reviewed-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Message-ID: &lt;20260715141300.2295392-1-lvivier@redhat.com&gt;
</content>
</entry>
<entry>
<title>hw/virtio-rng: Fix host use-after-free (CVE-2026-50624)</title>
<updated>2026-07-27T19:14:13+00:00</updated>
<author>
<name>Laurent Vivier</name>
<email>lvivier@redhat.com</email>
</author>
<published>2026-07-24T09:49:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=0be94d8d9c28e6b7235b34133d057090fe93be6c'/>
<id>urn:sha1:0be94d8d9c28e6b7235b34133d057090fe93be6c</id>
<content type='text'>
Fix a heap-use-after-free in the virtio-rng frontend when a delayed
rng-random backend completion arrives after the virtio-rng device has been
hot-unplugged.

Fixes: CVE-2026-50624
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3917
Reported-by: Jia Jia &lt;physicalmtea@gmail.com&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@oss.qualcomm.com&gt;
Signed-off-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Reviewed-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Message-ID: &lt;20260724094931.3005968-1-lvivier@redhat.com&gt;
</content>
</entry>
<entry>
<title>qom: Make InterfaceInfo[] uses const</title>
<updated>2025-04-25T15:00:41+00:00</updated>
<author>
<name>Philippe Mathieu-Daudé</name>
<email>philmd@linaro.org</email>
</author>
<published>2025-04-23T16:46:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=2cd09e47aa522dfc7bb206f13d6dccb68dd09887'/>
<id>urn:sha1:2cd09e47aa522dfc7bb206f13d6dccb68dd09887</id>
<content type='text'>
Mechanical change using:

  $ sed -i -E 's/\(InterfaceInfo.?\[/\(const InterfaceInfo\[/g' \
              $(git grep -lE '\(InterfaceInfo.?\[\]\)')

Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Signed-off-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Message-Id: &lt;20250424194905.82506-7-philmd@linaro.org&gt;
</content>
</entry>
<entry>
<title>qom: Have class_init() take a const data argument</title>
<updated>2025-04-25T15:00:41+00:00</updated>
<author>
<name>Philippe Mathieu-Daudé</name>
<email>philmd@linaro.org</email>
</author>
<published>2025-02-09T22:47:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=12d1a768bdfea6e27a3a829228840d72507613a1'/>
<id>urn:sha1:12d1a768bdfea6e27a3a829228840d72507613a1</id>
<content type='text'>
Mechanical change using gsed, then style manually adapted
to pass checkpatch.pl script.

Suggested-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Signed-off-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Message-Id: &lt;20250424194905.82506-4-philmd@linaro.org&gt;
</content>
</entry>
<entry>
<title>include: Rename sysemu/ -&gt; system/</title>
<updated>2024-12-20T16:44:56+00:00</updated>
<author>
<name>Philippe Mathieu-Daudé</name>
<email>philmd@linaro.org</email>
</author>
<published>2024-12-03T14:20:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=32cad1ffb81dcecf6f4a8af56d6e5892682839b1'/>
<id>urn:sha1:32cad1ffb81dcecf6f4a8af56d6e5892682839b1</id>
<content type='text'>
Headers in include/sysemu/ are not only related to system
*emulation*, they are also used by virtualization. Rename
as system/ which is clearer.

Files renamed manually then mechanical change using sed tool.

Signed-off-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Tested-by: Lei Yang &lt;leiyang@redhat.com&gt;
Message-Id: &lt;20241203172445.28576-1-philmd@linaro.org&gt;
</content>
</entry>
<entry>
<title>error: Drop superfluous #include "qapi/qmp/qerror.h"</title>
<updated>2023-02-23T12:56:14+00:00</updated>
<author>
<name>Markus Armbruster</name>
<email>armbru@redhat.com</email>
</author>
<published>2023-02-07T07:51:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=6f1e91f716a96651feae89dfd674b2ea3bf8e282'/>
<id>urn:sha1:6f1e91f716a96651feae89dfd674b2ea3bf8e282</id>
<content type='text'>
Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Message-Id: &lt;20230207075115.1525-2-armbru@redhat.com&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Reviewed-by: Juan Quintela &lt;quintela@redhat.com&gt;
Reviewed-by: Konstantin Kostiuk &lt;kkostiuk@redhat.com&gt;
</content>
</entry>
<entry>
<title>rng: make opened property read-only</title>
<updated>2022-05-14T10:33:44+00:00</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2022-05-09T09:46:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=6e577937485080f2dcebc6a3e5a4a9e8db841762'/>
<id>urn:sha1:6e577937485080f2dcebc6a3e5a4a9e8db841762</id>
<content type='text'>
The ``opened=on`` option in the command line or QMP ``object-add`` either had
no effect (if ``opened`` was the last option) or caused errors.  The property
is therefore useless and was deprecated in 6.0; make it read-only now.

Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>rng: Register "opened" as class property</title>
<updated>2020-10-13T19:56:30+00:00</updated>
<author>
<name>Eduardo Habkost</name>
<email>ehabkost@redhat.com</email>
</author>
<published>2020-09-21T22:10:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=29ee2a183205062f8b5b5b317e7fe392e9f57e64'/>
<id>urn:sha1:29ee2a183205062f8b5b5b317e7fe392e9f57e64</id>
<content type='text'>
Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.

Signed-off-by: Eduardo Habkost &lt;ehabkost@redhat.com&gt;
Reviewed-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Message-Id: &lt;20200921221045.699690-8-ehabkost@redhat.com&gt;
Signed-off-by: Eduardo Habkost &lt;ehabkost@redhat.com&gt;
</content>
</entry>
<entry>
<title>qom: Put name parameter before value / visitor parameter</title>
<updated>2020-07-10T13:18:08+00:00</updated>
<author>
<name>Markus Armbruster</name>
<email>armbru@redhat.com</email>
</author>
<published>2020-07-07T16:05:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=5325cc34a2ca985283134c7e264be7851b112d4e'/>
<id>urn:sha1:5325cc34a2ca985283134c7e264be7851b112d4e</id>
<content type='text'>
The object_property_set_FOO() setters take property name and value in
an unusual order:

    void object_property_set_FOO(Object *obj, FOO_TYPE value,
                                 const char *name, Error **errp)

Having to pass value before name feels grating.  Swap them.

Same for object_property_set(), object_property_get(), and
object_property_parse().

Convert callers with this Coccinelle script:

    @@
    identifier fun = {
        object_property_get, object_property_parse, object_property_set_str,
        object_property_set_link, object_property_set_bool,
        object_property_set_int, object_property_set_uint, object_property_set,
        object_property_set_qobject
    };
    expression obj, v, name, errp;
    @@
    -    fun(obj, v, name, errp)
    +    fun(obj, name, v, errp)

Chokes on hw/arm/musicpal.c's lcd_refresh() with the unhelpful error
message "no position information".  Convert that one manually.

Fails to convert hw/arm/armsse.c, because Coccinelle gets confused by
ARMSSE being used both as typedef and function-like macro there.
Convert manually.

Fails to convert hw/rx/rx-gdbsim.c, because Coccinelle gets confused
by RXCPU being used both as typedef and function-like macro there.
Convert manually.  The other files using RXCPU that way don't need
conversion.

Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Reviewed-by: Eric Blake &lt;eblake@redhat.com&gt;
Reviewed-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@virtuozzo.com&gt;
Message-Id: &lt;20200707160613.848843-27-armbru@redhat.com&gt;
[Straightforwad conflict with commit 2336172d9b "audio: set default
value for pcspk.iobase property" resolved]
</content>
</entry>
<entry>
<title>qom: Drop parameter @errp of object_property_add() &amp; friends</title>
<updated>2020-05-15T05:07:58+00:00</updated>
<author>
<name>Markus Armbruster</name>
<email>armbru@redhat.com</email>
</author>
<published>2020-05-05T15:29:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=d2623129a7dec1d3041ad1221dda1ca49c667532'/>
<id>urn:sha1:d2623129a7dec1d3041ad1221dda1ca49c667532</id>
<content type='text'>
The only way object_property_add() can fail is when a property with
the same name already exists.  Since our property names are all
hardcoded, failure is a programming error, and the appropriate way to
handle it is passing &amp;error_abort.

Same for its variants, except for object_property_add_child(), which
additionally fails when the child already has a parent.  Parentage is
also under program control, so this is a programming error, too.

We have a bit over 500 callers.  Almost half of them pass
&amp;error_abort, slightly fewer ignore errors, one test case handles
errors, and the remaining few callers pass them to their own callers.

The previous few commits demonstrated once again that ignoring
programming errors is a bad idea.

Of the few ones that pass on errors, several violate the Error API.
The Error ** argument must be NULL, &amp;error_abort, &amp;error_fatal, or a
pointer to a variable containing NULL.  Passing an argument of the
latter kind twice without clearing it in between is wrong: if the
first call sets an error, it no longer points to NULL for the second
call.  ich9_pm_add_properties(), sparc32_ledma_realize(),
sparc32_dma_realize(), xilinx_axidma_realize(), xilinx_enet_realize()
are wrong that way.

When the one appropriate choice of argument is &amp;error_abort, letting
users pick the argument is a bad idea.

Drop parameter @errp and assert the preconditions instead.

There's one exception to "duplicate property name is a programming
error": the way object_property_add() implements the magic (and
undocumented) "automatic arrayification".  Don't drop @errp there.
Instead, rename object_property_add() to object_property_try_add(),
and add the obvious wrapper object_property_add().

Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Reviewed-by: Eric Blake &lt;eblake@redhat.com&gt;
Reviewed-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Message-Id: &lt;20200505152926.18877-15-armbru@redhat.com&gt;
[Two semantic rebase conflicts resolved]
</content>
</entry>
</feed>
