qemu/backends
Stefano Garzarella 3e59a2255d cryptodev/vhost: allocate CryptoDevBackendVhost using g_mem0()
The function `vhost_dev_init()` expects the `struct vhost_dev`
(passed as a parameter) to be fully initialized. This is important
because some parts of the code check whether `vhost_dev->config_ops`
is NULL to determine if it has been set (e.g. later via
`vhost_dev_set_config_notifier`).

To ensure this initialization, it’s better to allocate the entire
`CryptoDevBackendVhost` structure (which includes `vhost_dev`) using
`g_mem0()`, following the same approach used for other vhost devices,
such as in `vhost_net_init()`.

Fixes: 042cea274c ("cryptodev: add vhost-user as a new cryptodev backend")
Cc: qemu-stable@nongnu.org
Reported-by: myluo24@m.fudan.edu.cn
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20250211135523.101203-1-sgarzare@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 83cb18ac45)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2025-03-22 10:52:25 +03:00
..
tpm tpm: fix crash when FD >= 1024 and unnecessary errors due to EINTR 2023-09-13 23:13:45 +03:00
confidential-guest-support.c confidential guest support: Introduce new confidential guest support class 2021-02-08 16:57:37 +11:00
cryptodev-builtin.c backends/cryptodev-builtin: Fix local_error leaks 2024-04-30 20:10:14 +03:00
cryptodev-lkcf.c cryptodev: Add a lkcf-backend for cryptodev 2022-11-02 06:56:32 -04:00
cryptodev-vhost-user.c backends/cryptodev-vhost-user: Fix local_error leaks 2025-01-17 09:16:56 +03:00
cryptodev-vhost.c cryptodev/vhost: allocate CryptoDevBackendVhost using g_mem0() 2025-03-22 10:52:25 +03:00
cryptodev.c virtio-crypto: Support asynchronous mode 2022-11-02 06:56:32 -04:00
dbus-vmstate.c dbus-vmstate: Restrict error checks to registered proxies in dbus_get_proxies 2022-08-18 10:35:44 +04:00
dbus-vmstate1.xml docs: move D-Bus VMState documentation to source XML 2021-12-21 10:50:21 +04:00
hostmem-epc.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
hostmem-file.c include: Move qemu_madvise() and related #defines to new qemu/madvise.h 2022-02-21 13:30:20 +00:00
hostmem-memfd.c hostmem: Wire up RAM_NORESERVE via "reserve" property 2021-06-15 20:27:38 +02:00
hostmem-ram.c hostmem: Wire up RAM_NORESERVE via "reserve" property 2021-06-15 20:27:38 +02:00
hostmem.c hostmem: Allow for specifying a ThreadContext for preallocation 2022-10-27 11:01:03 +02:00
Kconfig tpm: Move backend code under the 'backends/' directory 2020-06-19 07:25:55 -04:00
meson.build cryptodev: Add a lkcf-backend for cryptodev 2022-11-02 06:56:32 -04:00
rng-builtin.c replay: rng-builtin support 2021-02-08 15:15:32 +01:00
rng-egd.c backends: Improve error messages when property can no longer be set 2022-10-27 07:56:56 +02:00
rng-random.c backends: Improve error messages when property can no longer be set 2022-10-27 07:56:56 +02:00
rng.c rng: make opened property read-only 2022-05-14 12:33:44 +02:00
trace-events docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
vhost-user.c vhost: enable vrings in vhost_dev_start() for vhost-user devices 2022-12-01 02:30:04 -05:00