From: Jason Wang <jasowang@redhat.com>
To: Alexander Bulekov <alxndr@bu.edu>
Cc: mst@redhat.com, qemu-stable@nongnu.org, stefanha@redhat.com,
qemu-devel@nongnu.org
Subject: Re: [PATCH] net: use peer when purging queue in qemu_flush_or_purge_queue_packets()
Date: Mon, 18 May 2020 11:34:55 +0800 [thread overview]
Message-ID: <fbe082da-acb2-9a2e-a16f-27928211d5d9@redhat.com> (raw)
In-Reply-To: <20200511042150.44na6uwgf6mhdngx@mozz.bu.edu>
On 2020/5/11 下午12:21, Alexander Bulekov wrote:
> 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" <alxndr@bu.edu>
>> Fixes: ca77d85e1dbf9 ("net: complete all queued packets on VM stop")
>> Cc: qemu-stable@nongnu.org
>> Signed-off-by: Jason Wang <jasowang@redhat.com>
> Hi Jason,
> With this patch, I can no longer reproduce the crash
>
> Acked-by: Alexander Bulekov <alxndr@bu.edu>
>
> Thanks!
Applied.
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
>>
next prev parent reply other threads:[~2020-05-18 3:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-11 4:04 [PATCH] net: use peer when purging queue in qemu_flush_or_purge_queue_packets() Jason Wang
2020-05-11 4:21 ` Alexander Bulekov
2020-05-18 3:34 ` Jason Wang [this message]
2020-05-18 8:00 ` Philippe Mathieu-Daudé
2020-05-18 8:38 ` Jason Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fbe082da-acb2-9a2e-a16f-27928211d5d9@redhat.com \
--to=jasowang@redhat.com \
--cc=alxndr@bu.edu \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).