All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: qemu-devel@nongnu.org, qemu-security@nongnu.org
Cc: alxndr@bu.edu, Jason Wang <jasowang@redhat.com>,
	philmd@redhat.com, ppandit@redhat.com
Subject: [PATCH V4 10/10] lan9118: switch to use qemu_receive_packet() for loopback
Date: Fri,  5 Mar 2021 14:26:38 +0800	[thread overview]
Message-ID: <20210305062638.6749-11-jasowang@redhat.com> (raw)
In-Reply-To: <20210305062638.6749-1-jasowang@redhat.com>

From: Alexander Bulekov <alxndr@bu.edu>

This patch switches to use qemu_receive_packet() which can detect
reentrancy and return early.

This is intended to address CVE-2021-3416.

Cc: Prasad J Pandit <ppandit@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/lan9118.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c
index abc796285a..6aff424cbe 100644
--- a/hw/net/lan9118.c
+++ b/hw/net/lan9118.c
@@ -680,7 +680,7 @@ static void do_tx_packet(lan9118_state *s)
     /* FIXME: Honor TX disable, and allow queueing of packets.  */
     if (s->phy_control & 0x4000)  {
         /* This assumes the receive routine doesn't touch the VLANClient.  */
-        lan9118_receive(qemu_get_queue(s->nic), s->txp->data, s->txp->len);
+        qemu_receive_packet(qemu_get_queue(s->nic), s->txp->data, s->txp->len);
     } else {
         qemu_send_packet(qemu_get_queue(s->nic), s->txp->data, s->txp->len);
     }
-- 
2.24.3 (Apple Git-128)



  parent reply	other threads:[~2021-03-05  6:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-05  6:26 [PATCH V4 00/10] Detect reentrant RX casued by loopback Jason Wang
2021-03-05  6:26 ` [PATCH V4 01/10] net: introduce qemu_receive_packet() Jason Wang
2021-03-05  6:26 ` [PATCH V4 02/10] e1000: switch to use qemu_receive_packet() for loopback Jason Wang
2021-03-05  6:26 ` [PATCH V4 03/10] dp8393x: switch to use qemu_receive_packet() for loopback packet Jason Wang
2021-03-05  6:26 ` [PATCH V4 04/10] msf2-mac: switch to use qemu_receive_packet() for loopback Jason Wang
2021-03-05  6:26 ` [PATCH V4 05/10] sungem: " Jason Wang
2021-03-05  6:26 ` [PATCH V4 06/10] tx_pkt: switch to use qemu_receive_packet_iov() " Jason Wang
2021-03-05  6:26 ` [PATCH V4 07/10] rtl8139: switch to use qemu_receive_packet() " Jason Wang
2021-03-05  6:26 ` [PATCH V4 08/10] pcnet: " Jason Wang
2021-03-05  6:26 ` [PATCH V4 09/10] cadence_gem: " Jason Wang
2021-03-05  6:26 ` Jason Wang [this message]
2021-03-05  6:39 ` [QEMU-SECURITY] [PATCH V4 00/10] Detect reentrant RX casued by loopback P J P
2021-03-05  6:44   ` Jason Wang
2021-03-05  9:38 ` Philippe Mathieu-Daudé
2021-03-08  3:26   ` Jason Wang
2021-03-08  3:55 ` 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=20210305062638.6749-11-jasowang@redhat.com \
    --to=jasowang@redhat.com \
    --cc=alxndr@bu.edu \
    --cc=philmd@redhat.com \
    --cc=ppandit@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-security@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.