On 28-Jun-2023, at 5:12 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
On Wed, Jun 28, 2023 at 04:58:04PM +0530, Ani Sinha wrote:
When 'vhost=off' or no vhost specific options at all are passed for the tap
net-device backend, tap_get_vhost_net() can return NULL. The function
net_init_tap_one() does not call vhost_net_init() on such cases and therefore
vhost_net pointer within the tap device state structure remains NULL. Hence,
assertion here on a NULL pointer return from tap_get_vhost_net() would not be
correct. Remove it and fix the crash generated by qemu upon initialization in
the following call chain :
qdev_realize() -> pci_qdev_realize() -> virtio_device_realize() ->
virtio_bus_device_plugged() -> virtio_net_get_features() -> get_vhost_net()
fixes: 0e994668d00c9c ("vhost_net: add an assertion for TAP client backends")
Signed-off-by: Ani Sinha <anisinha@redhat.com>
I added a bunch of tags and sent it upstream. Take a look
at the pull request so you can do it yourself going
forward, pls.