summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorJason Wang2021-02-24 06:00:01 +0100
committerJason Wang2021-03-15 09:41:22 +0100
commit26194a58f4eb83c5bdf4061a1628508084450ba1 (patch)
tree002ff34f25c1586823e4e4e950c8c4993b0f9fa2 /hw
parentdp8393x: switch to use qemu_receive_packet() for loopback packet (diff)
downloadqemu-26194a58f4eb83c5bdf4061a1628508084450ba1.tar.gz
qemu-26194a58f4eb83c5bdf4061a1628508084450ba1.tar.xz
qemu-26194a58f4eb83c5bdf4061a1628508084450ba1.zip
msf2-mac: switch to use qemu_receive_packet() for loopback
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> Cc: qemu-stable@nongnu.org Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/net/msf2-emac.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/net/msf2-emac.c b/hw/net/msf2-emac.c
index 32ba9e8412..3e6206044f 100644
--- a/hw/net/msf2-emac.c
+++ b/hw/net/msf2-emac.c
@@ -158,7 +158,7 @@ static void msf2_dma_tx(MSF2EmacState *s)
* R_CFG1 bit 0 is set.
*/
if (s->regs[R_CFG1] & R_CFG1_LB_EN_MASK) {
- nc->info->receive(nc, buf, size);
+ qemu_receive_packet(nc, buf, size);
} else {
qemu_send_packet(nc, buf, size);
}