summary refs log tree commit diff stats
path: root/include/net/net.h
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@daynix.com>2023-06-01 12:18:59 +0900
committerJason Wang <jasowang@redhat.com>2023-11-21 15:42:34 +0800
commit9050f976e447444ea6ee2ba12c9f77e4b0dc54bc (patch)
treef538085c9963ed31cb8f84df51d9b18c8b389d25 /include/net/net.h
parent7d0fefdf81f5973334c344f6b8e1896c309dff66 (diff)
downloadfocaccia-qemu-9050f976e447444ea6ee2ba12c9f77e4b0dc54bc.tar.gz
focaccia-qemu-9050f976e447444ea6ee2ba12c9f77e4b0dc54bc.zip
net: Update MemReentrancyGuard for NIC
Recently MemReentrancyGuard was added to DeviceState to record that the
device is engaging in I/O. The network device backend needs to update it
when delivering a packet to a device.

This implementation follows what bottom half does, but it does not add
a tracepoint for the case that the network device backend started
delivering a packet to a device which is already engaging in I/O. This
is because such reentrancy frequently happens for
qemu_flush_queued_packets() and is insignificant.

Fixes: CVE-2023-3019
Reported-by: Alexander Bulekov <alxndr@bu.edu>
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Acked-by: Alexander Bulekov <alxndr@bu.edu>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'include/net/net.h')
-rw-r--r--include/net/net.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/net.h b/include/net/net.h
index 24deea2dbd..ffbd2c8d56 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -126,6 +126,7 @@ typedef QTAILQ_HEAD(NetClientStateList, NetClientState) NetClientStateList;
 typedef struct NICState {
     NetClientState *ncs;
     NICConf *conf;
+    MemReentrancyGuard *reentrancy_guard;
     void *opaque;
     bool peer_deleted;
 } NICState;