qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] net/vhost-net: do not assert on null pointer return from tap


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] net/vhost-net: do not assert on null pointer return from tap_get_vhost_net()
Date: Wed, 28 Jun 2023 13:50:52 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0

On 28/6/23 13:44, Ani Sinha wrote:


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.

I thought only maintainers sends PR? Do you have any handy scripts?

https://github.com/stefanha/git-publish/blob/master/git-publish.pod#sending-pull-requests



reply via email to

[Prev in Thread] Current Thread [Next in Thread]