qemu-stable
[Top][All Lists]
Advanced

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

Re: [PATCH] net: use peer when purging queue in qemu_flush_or_purge_queu


From: Alexander Bulekov
Subject: Re: [PATCH] net: use peer when purging queue in qemu_flush_or_purge_queue_packets()
Date: Mon, 11 May 2020 00:21:50 -0400
User-agent: NeoMutt/20180716

On 200511 1204, Jason Wang wrote:
> The sender of packet will be checked in the qemu_net_queue_purge() but
> we use NetClientState not its peer when trying to purge the incoming
> queue in qemu_flush_or_purge_packets(). This will trigger the assert
> in virtio_net_reset since we can't pass the sender check.
> 
> Fix by using the peer.
> 
> Reported-by: "Alexander Bulekov" <address@hidden>
> Fixes: ca77d85e1dbf9 ("net: complete all queued packets on VM stop")
> Cc: address@hidden
> Signed-off-by: Jason Wang <address@hidden>

Hi Jason,
With this patch, I can no longer reproduce the crash

Acked-by: Alexander Bulekov <address@hidden>

Thanks!

> ---
>  net/net.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/net.c b/net/net.c
> index 38778e831d..9e47cf727d 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -610,7 +610,7 @@ void qemu_flush_or_purge_queued_packets(NetClientState 
> *nc, bool purge)
>          qemu_notify_event();
>      } else if (purge) {
>          /* Unable to empty the queue, purge remaining packets */
> -        qemu_net_queue_purge(nc->incoming_queue, nc);
> +        qemu_net_queue_purge(nc->incoming_queue, nc->peer);
>      }
>  }
>  
> -- 
> 2.20.1
> 



reply via email to

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