* Wed Dec 06 2023 Jon Maloy <jmaloy@redhat.com> - 6.2.0-43
- kvm-net-Provide-MemReentrancyGuard-to-qemu_new_nic.patch [RHEL-7309] - kvm-net-Update-MemReentrancyGuard-for-NIC.patch [RHEL-7309] - kvm-vhost-release-memory_listener-object-in-error-path.patch [RHEL-7567] - kvm-ui-fix-crash-when-there-are-no-active_console.patch [RHEL-2600] - Resolves: RHEL-7309 (CVE-2023-3019 virt:rhel/qemu-kvm: QEMU: e1000e: heap use-after-free in e1000e_write_packet_to_guest() [rhel-8]) - Resolves: RHEL-7567 ([RHEL8][clone]VM crash when guest running testpmd and delete created vhostuserclient port on host) - Resolves: RHEL-2600 (qemu core dump occurs when client connects to VNC server because qemu cmd only adds vnc but without graphics device)
This commit is contained in:
parent
a32e67a8e7
commit
8bba2efc03
611
kvm-net-Provide-MemReentrancyGuard-to-qemu_new_nic.patch
Normal file
611
kvm-net-Provide-MemReentrancyGuard-to-qemu_new_nic.patch
Normal file
@ -0,0 +1,611 @@
|
||||
From 2ae925a6d55a77627be8d1146f2b9ed139dbdb77 Mon Sep 17 00:00:00 2001
|
||||
From: Jon Maloy <jmaloy@redhat.com>
|
||||
Date: Thu, 23 Nov 2023 11:30:46 -0500
|
||||
Subject: [PATCH 1/4] net: Provide MemReentrancyGuard * to qemu_new_nic()
|
||||
|
||||
RH-Author: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-MergeRequest: 331: net: Provide MemReentrancyGuard * to qemu_new_nic()
|
||||
RH-Jira: RHEL-7309
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
|
||||
RH-Acked-by: Jason Wang <jasowang@redhat.com>
|
||||
RH-Commit: [1/2] bc963fb349b90288f547de97a5cbe9a74f856419 (redhat/rhel/src/qemu-kvm/jons-qemu-kvm-2)
|
||||
|
||||
Jira: https://issues.redhat.com/browse/RHEL-7309
|
||||
CVE: CVE-2023-3019
|
||||
Upstream: Merged
|
||||
Conflicts: hw/net/hw/net/xen_nic.c seems to have undergone significant changes upstream,
|
||||
so the change had to be manually adapted to the old code.
|
||||
|
||||
commit 7d0fefdf81f5973334c344f6b8e1896c309dff66
|
||||
Author: Akihiko Odaki <akihiko.odaki@daynix.com>
|
||||
Date: Thu Jun 1 12:18:58 2023 +0900
|
||||
|
||||
net: Provide MemReentrancyGuard * to qemu_new_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.
|
||||
|
||||
In preparation for such a change, add MemReentrancyGuard * as a
|
||||
parameter of qemu_new_nic().
|
||||
|
||||
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
|
||||
Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
Signed-off-by: Jason Wang <jasowang@redhat.com>
|
||||
|
||||
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
|
||||
---
|
||||
hw/net/allwinner-sun8i-emac.c | 3 ++-
|
||||
hw/net/allwinner_emac.c | 3 ++-
|
||||
hw/net/cadence_gem.c | 3 ++-
|
||||
hw/net/dp8393x.c | 3 ++-
|
||||
hw/net/e1000.c | 3 ++-
|
||||
hw/net/e1000e.c | 2 +-
|
||||
hw/net/eepro100.c | 4 +++-
|
||||
hw/net/etraxfs_eth.c | 3 ++-
|
||||
hw/net/fsl_etsec/etsec.c | 3 ++-
|
||||
hw/net/ftgmac100.c | 3 ++-
|
||||
hw/net/i82596.c | 2 +-
|
||||
hw/net/imx_fec.c | 2 +-
|
||||
hw/net/lan9118.c | 3 ++-
|
||||
hw/net/mcf_fec.c | 3 ++-
|
||||
hw/net/mipsnet.c | 3 ++-
|
||||
hw/net/msf2-emac.c | 3 ++-
|
||||
hw/net/ne2000-isa.c | 3 ++-
|
||||
hw/net/ne2000-pci.c | 3 ++-
|
||||
hw/net/npcm7xx_emc.c | 3 ++-
|
||||
hw/net/opencores_eth.c | 3 ++-
|
||||
hw/net/pcnet.c | 3 ++-
|
||||
hw/net/rocker/rocker_fp.c | 4 ++--
|
||||
hw/net/rtl8139.c | 3 ++-
|
||||
hw/net/smc91c111.c | 3 ++-
|
||||
hw/net/spapr_llan.c | 3 ++-
|
||||
hw/net/stellaris_enet.c | 3 ++-
|
||||
hw/net/sungem.c | 2 +-
|
||||
hw/net/sunhme.c | 3 ++-
|
||||
hw/net/tulip.c | 3 ++-
|
||||
hw/net/virtio-net.c | 6 ++++--
|
||||
hw/net/vmxnet3.c | 2 +-
|
||||
hw/net/xen_nic.c | 3 ++-
|
||||
hw/net/xgmac.c | 3 ++-
|
||||
hw/net/xilinx_axienet.c | 3 ++-
|
||||
hw/net/xilinx_ethlite.c | 3 ++-
|
||||
hw/usb/dev-network.c | 3 ++-
|
||||
include/net/net.h | 1 +
|
||||
net/net.c | 1 +
|
||||
38 files changed, 72 insertions(+), 38 deletions(-)
|
||||
|
||||
diff --git a/hw/net/allwinner-sun8i-emac.c b/hw/net/allwinner-sun8i-emac.c
|
||||
index ff611f18fb..9d0885ee15 100644
|
||||
--- a/hw/net/allwinner-sun8i-emac.c
|
||||
+++ b/hw/net/allwinner-sun8i-emac.c
|
||||
@@ -810,7 +810,8 @@ static void allwinner_sun8i_emac_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_allwinner_sun8i_emac_info, &s->conf,
|
||||
- object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
+ object_get_typename(OBJECT(dev)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
}
|
||||
|
||||
diff --git a/hw/net/allwinner_emac.c b/hw/net/allwinner_emac.c
|
||||
index ddddf35c45..b3d73143bf 100644
|
||||
--- a/hw/net/allwinner_emac.c
|
||||
+++ b/hw/net/allwinner_emac.c
|
||||
@@ -453,7 +453,8 @@ static void aw_emac_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_aw_emac_info, &s->conf,
|
||||
- object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
+ object_get_typename(OBJECT(dev)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
|
||||
fifo8_create(&s->rx_fifo, RX_FIFO_SIZE);
|
||||
diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c
|
||||
index 24b3a0ff66..cb61a76417 100644
|
||||
--- a/hw/net/cadence_gem.c
|
||||
+++ b/hw/net/cadence_gem.c
|
||||
@@ -1633,7 +1633,8 @@ static void gem_realize(DeviceState *dev, Error **errp)
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
|
||||
s->nic = qemu_new_nic(&net_gem_info, &s->conf,
|
||||
- object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
+ object_get_typename(OBJECT(dev)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, s);
|
||||
|
||||
if (s->jumbo_max_len > MAX_FRAME_SIZE) {
|
||||
error_setg(errp, "jumbo-max-len is greater than %d",
|
||||
diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c
|
||||
index 45b954e46c..abfcc6f69f 100644
|
||||
--- a/hw/net/dp8393x.c
|
||||
+++ b/hw/net/dp8393x.c
|
||||
@@ -943,7 +943,8 @@ static void dp8393x_realize(DeviceState *dev, Error **errp)
|
||||
"dp8393x-regs", SONIC_REG_COUNT << s->it_shift);
|
||||
|
||||
s->nic = qemu_new_nic(&net_dp83932_info, &s->conf,
|
||||
- object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
+ object_get_typename(OBJECT(dev)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
|
||||
s->watchdog = timer_new_ns(QEMU_CLOCK_VIRTUAL, dp8393x_watchdog, s);
|
||||
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
|
||||
index 282d01e374..86da1ae39e 100644
|
||||
--- a/hw/net/e1000.c
|
||||
+++ b/hw/net/e1000.c
|
||||
@@ -1733,7 +1733,8 @@ static void pci_e1000_realize(PCIDevice *pci_dev, Error **errp)
|
||||
macaddr);
|
||||
|
||||
d->nic = qemu_new_nic(&net_e1000_info, &d->conf,
|
||||
- object_get_typename(OBJECT(d)), dev->id, d);
|
||||
+ object_get_typename(OBJECT(d)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, d);
|
||||
|
||||
qemu_format_nic_info_str(qemu_get_queue(d->nic), macaddr);
|
||||
|
||||
diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
|
||||
index d35bc1f0b0..c6096fa848 100644
|
||||
--- a/hw/net/e1000e.c
|
||||
+++ b/hw/net/e1000e.c
|
||||
@@ -340,7 +340,7 @@ e1000e_init_net_peer(E1000EState *s, PCIDevice *pci_dev, uint8_t *macaddr)
|
||||
int i;
|
||||
|
||||
s->nic = qemu_new_nic(&net_e1000e_info, &s->conf,
|
||||
- object_get_typename(OBJECT(s)), dev->id, s);
|
||||
+ object_get_typename(OBJECT(s)), dev->id, &dev->mem_reentrancy_guard, s);
|
||||
|
||||
s->core.max_queue_num = s->conf.peers.queues ? s->conf.peers.queues - 1 : 0;
|
||||
|
||||
diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
|
||||
index 16e95ef9cc..16ca4dda04 100644
|
||||
--- a/hw/net/eepro100.c
|
||||
+++ b/hw/net/eepro100.c
|
||||
@@ -1865,7 +1865,9 @@ static void e100_nic_realize(PCIDevice *pci_dev, Error **errp)
|
||||
nic_reset(s);
|
||||
|
||||
s->nic = qemu_new_nic(&net_eepro100_info, &s->conf,
|
||||
- object_get_typename(OBJECT(pci_dev)), pci_dev->qdev.id, s);
|
||||
+ object_get_typename(OBJECT(pci_dev)),
|
||||
+ pci_dev->qdev.id,
|
||||
+ &pci_dev->qdev.mem_reentrancy_guard, s);
|
||||
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
TRACE(OTHER, logout("%s\n", qemu_get_queue(s->nic)->info_str));
|
||||
diff --git a/hw/net/etraxfs_eth.c b/hw/net/etraxfs_eth.c
|
||||
index 1b82aec794..ba57a978d1 100644
|
||||
--- a/hw/net/etraxfs_eth.c
|
||||
+++ b/hw/net/etraxfs_eth.c
|
||||
@@ -618,7 +618,8 @@ static void etraxfs_eth_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_etraxfs_info, &s->conf,
|
||||
- object_get_typename(OBJECT(s)), dev->id, s);
|
||||
+ object_get_typename(OBJECT(s)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
|
||||
s->phy.read = tdk_read;
|
||||
diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c
|
||||
index bd9d62b559..f790613b52 100644
|
||||
--- a/hw/net/fsl_etsec/etsec.c
|
||||
+++ b/hw/net/fsl_etsec/etsec.c
|
||||
@@ -391,7 +391,8 @@ static void etsec_realize(DeviceState *dev, Error **errp)
|
||||
eTSEC *etsec = ETSEC_COMMON(dev);
|
||||
|
||||
etsec->nic = qemu_new_nic(&net_etsec_info, &etsec->conf,
|
||||
- object_get_typename(OBJECT(dev)), dev->id, etsec);
|
||||
+ object_get_typename(OBJECT(dev)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, etsec);
|
||||
qemu_format_nic_info_str(qemu_get_queue(etsec->nic), etsec->conf.macaddr.a);
|
||||
|
||||
etsec->ptimer = ptimer_init(etsec_timer_hit, etsec, PTIMER_POLICY_DEFAULT);
|
||||
diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c
|
||||
index 25685ba3a9..781e7f352e 100644
|
||||
--- a/hw/net/ftgmac100.c
|
||||
+++ b/hw/net/ftgmac100.c
|
||||
@@ -1111,7 +1111,8 @@ static void ftgmac100_realize(DeviceState *dev, Error **errp)
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
|
||||
s->nic = qemu_new_nic(&net_ftgmac100_info, &s->conf,
|
||||
- object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
+ object_get_typename(OBJECT(dev)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
}
|
||||
|
||||
diff --git a/hw/net/i82596.c b/hw/net/i82596.c
|
||||
index ec21e2699a..dc64246f75 100644
|
||||
--- a/hw/net/i82596.c
|
||||
+++ b/hw/net/i82596.c
|
||||
@@ -743,7 +743,7 @@ void i82596_common_init(DeviceState *dev, I82596State *s, NetClientInfo *info)
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
}
|
||||
s->nic = qemu_new_nic(info, &s->conf, object_get_typename(OBJECT(dev)),
|
||||
- dev->id, s);
|
||||
+ dev->id, &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
|
||||
if (USE_TIMER) {
|
||||
diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c
|
||||
index 9c7035bc94..ed19ee9350 100644
|
||||
--- a/hw/net/imx_fec.c
|
||||
+++ b/hw/net/imx_fec.c
|
||||
@@ -1310,7 +1310,7 @@ static void imx_eth_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
s->nic = qemu_new_nic(&imx_eth_net_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)),
|
||||
- dev->id, s);
|
||||
+ dev->id, &dev->mem_reentrancy_guard, s);
|
||||
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
}
|
||||
diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c
|
||||
index 6aff424cbe..942bce9ae6 100644
|
||||
--- a/hw/net/lan9118.c
|
||||
+++ b/hw/net/lan9118.c
|
||||
@@ -1354,7 +1354,8 @@ static void lan9118_realize(DeviceState *dev, Error **errp)
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
|
||||
s->nic = qemu_new_nic(&net_lan9118_info, &s->conf,
|
||||
- object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
+ object_get_typename(OBJECT(dev)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
s->eeprom[0] = 0xa5;
|
||||
for (i = 0; i < 6; i++) {
|
||||
diff --git a/hw/net/mcf_fec.c b/hw/net/mcf_fec.c
|
||||
index 25e3e453ab..a6be7bf413 100644
|
||||
--- a/hw/net/mcf_fec.c
|
||||
+++ b/hw/net/mcf_fec.c
|
||||
@@ -643,7 +643,8 @@ static void mcf_fec_realize(DeviceState *dev, Error **errp)
|
||||
mcf_fec_state *s = MCF_FEC_NET(dev);
|
||||
|
||||
s->nic = qemu_new_nic(&net_mcf_fec_info, &s->conf,
|
||||
- object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
+ object_get_typename(OBJECT(dev)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
}
|
||||
|
||||
diff --git a/hw/net/mipsnet.c b/hw/net/mipsnet.c
|
||||
index 2ade72dea0..8e925de867 100644
|
||||
--- a/hw/net/mipsnet.c
|
||||
+++ b/hw/net/mipsnet.c
|
||||
@@ -255,7 +255,8 @@ static void mipsnet_realize(DeviceState *dev, Error **errp)
|
||||
sysbus_init_irq(sbd, &s->irq);
|
||||
|
||||
s->nic = qemu_new_nic(&net_mipsnet_info, &s->conf,
|
||||
- object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
+ object_get_typename(OBJECT(dev)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
}
|
||||
|
||||
diff --git a/hw/net/msf2-emac.c b/hw/net/msf2-emac.c
|
||||
index 9278fdce0b..1efa3dbf01 100644
|
||||
--- a/hw/net/msf2-emac.c
|
||||
+++ b/hw/net/msf2-emac.c
|
||||
@@ -527,7 +527,8 @@ static void msf2_emac_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_msf2_emac_info, &s->conf,
|
||||
- object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
+ object_get_typename(OBJECT(dev)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
}
|
||||
|
||||
diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c
|
||||
index dd6f6e34d3..30bd20c293 100644
|
||||
--- a/hw/net/ne2000-isa.c
|
||||
+++ b/hw/net/ne2000-isa.c
|
||||
@@ -74,7 +74,8 @@ static void isa_ne2000_realizefn(DeviceState *dev, Error **errp)
|
||||
ne2000_reset(s);
|
||||
|
||||
s->nic = qemu_new_nic(&net_ne2000_isa_info, &s->c,
|
||||
- object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
+ object_get_typename(OBJECT(dev)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->c.macaddr.a);
|
||||
}
|
||||
|
||||
diff --git a/hw/net/ne2000-pci.c b/hw/net/ne2000-pci.c
|
||||
index 9e5d10859a..4f8a699081 100644
|
||||
--- a/hw/net/ne2000-pci.c
|
||||
+++ b/hw/net/ne2000-pci.c
|
||||
@@ -71,7 +71,8 @@ static void pci_ne2000_realize(PCIDevice *pci_dev, Error **errp)
|
||||
|
||||
s->nic = qemu_new_nic(&net_ne2000_info, &s->c,
|
||||
object_get_typename(OBJECT(pci_dev)),
|
||||
- pci_dev->qdev.id, s);
|
||||
+ pci_dev->qdev.id,
|
||||
+ &pci_dev->qdev.mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->c.macaddr.a);
|
||||
}
|
||||
|
||||
diff --git a/hw/net/npcm7xx_emc.c b/hw/net/npcm7xx_emc.c
|
||||
index 7c892f820f..dd1d0ad3bc 100644
|
||||
--- a/hw/net/npcm7xx_emc.c
|
||||
+++ b/hw/net/npcm7xx_emc.c
|
||||
@@ -802,7 +802,8 @@ static void npcm7xx_emc_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&emc->conf.macaddr);
|
||||
emc->nic = qemu_new_nic(&net_npcm7xx_emc_info, &emc->conf,
|
||||
- object_get_typename(OBJECT(dev)), dev->id, emc);
|
||||
+ object_get_typename(OBJECT(dev)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, emc);
|
||||
qemu_format_nic_info_str(qemu_get_queue(emc->nic), emc->conf.macaddr.a);
|
||||
}
|
||||
|
||||
diff --git a/hw/net/opencores_eth.c b/hw/net/opencores_eth.c
|
||||
index 0b3dc3146e..f96d6ea2cc 100644
|
||||
--- a/hw/net/opencores_eth.c
|
||||
+++ b/hw/net/opencores_eth.c
|
||||
@@ -732,7 +732,8 @@ static void sysbus_open_eth_realize(DeviceState *dev, Error **errp)
|
||||
sysbus_init_irq(sbd, &s->irq);
|
||||
|
||||
s->nic = qemu_new_nic(&net_open_eth_info, &s->conf,
|
||||
- object_get_typename(OBJECT(s)), dev->id, s);
|
||||
+ object_get_typename(OBJECT(s)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, s);
|
||||
}
|
||||
|
||||
static void qdev_open_eth_reset(DeviceState *dev)
|
||||
diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c
|
||||
index dcd3fc4948..da910a70bf 100644
|
||||
--- a/hw/net/pcnet.c
|
||||
+++ b/hw/net/pcnet.c
|
||||
@@ -1718,7 +1718,8 @@ void pcnet_common_init(DeviceState *dev, PCNetState *s, NetClientInfo *info)
|
||||
s->poll_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, pcnet_poll_timer, s);
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
- s->nic = qemu_new_nic(info, &s->conf, object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
+ s->nic = qemu_new_nic(info, &s->conf, object_get_typename(OBJECT(dev)),
|
||||
+ dev->id, &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
|
||||
/* Initialize the PROM */
|
||||
diff --git a/hw/net/rocker/rocker_fp.c b/hw/net/rocker/rocker_fp.c
|
||||
index cbeed65bd5..0d21948ada 100644
|
||||
--- a/hw/net/rocker/rocker_fp.c
|
||||
+++ b/hw/net/rocker/rocker_fp.c
|
||||
@@ -241,8 +241,8 @@ FpPort *fp_port_alloc(Rocker *r, char *sw_name,
|
||||
port->conf.bootindex = -1;
|
||||
port->conf.peers = *peers;
|
||||
|
||||
- port->nic = qemu_new_nic(&fp_port_info, &port->conf,
|
||||
- sw_name, NULL, port);
|
||||
+ port->nic = qemu_new_nic(&fp_port_info, &port->conf, sw_name, NULL,
|
||||
+ &DEVICE(r)->mem_reentrancy_guard, port);
|
||||
qemu_format_nic_info_str(qemu_get_queue(port->nic),
|
||||
port->conf.macaddr.a);
|
||||
|
||||
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
|
||||
index 3ffb9dd22c..a3565c7159 100644
|
||||
--- a/hw/net/rtl8139.c
|
||||
+++ b/hw/net/rtl8139.c
|
||||
@@ -3400,7 +3400,8 @@ static void pci_rtl8139_realize(PCIDevice *dev, Error **errp)
|
||||
s->eeprom.contents[9] = s->conf.macaddr.a[4] | s->conf.macaddr.a[5] << 8;
|
||||
|
||||
s->nic = qemu_new_nic(&net_rtl8139_info, &s->conf,
|
||||
- object_get_typename(OBJECT(dev)), d->id, s);
|
||||
+ object_get_typename(OBJECT(dev)), d->id,
|
||||
+ &d->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
|
||||
s->cplus_txbuffer = NULL;
|
||||
diff --git a/hw/net/smc91c111.c b/hw/net/smc91c111.c
|
||||
index ad778cd8fc..4eda971ef3 100644
|
||||
--- a/hw/net/smc91c111.c
|
||||
+++ b/hw/net/smc91c111.c
|
||||
@@ -783,7 +783,8 @@ static void smc91c111_realize(DeviceState *dev, Error **errp)
|
||||
sysbus_init_irq(sbd, &s->irq);
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_smc91c111_info, &s->conf,
|
||||
- object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
+ object_get_typename(OBJECT(dev)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
/* ??? Save/restore. */
|
||||
}
|
||||
diff --git a/hw/net/spapr_llan.c b/hw/net/spapr_llan.c
|
||||
index a6876a936d..475d5f3a34 100644
|
||||
--- a/hw/net/spapr_llan.c
|
||||
+++ b/hw/net/spapr_llan.c
|
||||
@@ -325,7 +325,8 @@ static void spapr_vlan_realize(SpaprVioDevice *sdev, Error **errp)
|
||||
memcpy(&dev->perm_mac.a, &dev->nicconf.macaddr.a, sizeof(dev->perm_mac.a));
|
||||
|
||||
dev->nic = qemu_new_nic(&net_spapr_vlan_info, &dev->nicconf,
|
||||
- object_get_typename(OBJECT(sdev)), sdev->qdev.id, dev);
|
||||
+ object_get_typename(OBJECT(sdev)), sdev->qdev.id,
|
||||
+ &sdev->qdev.mem_reentrancy_guard, dev);
|
||||
qemu_format_nic_info_str(qemu_get_queue(dev->nic), dev->nicconf.macaddr.a);
|
||||
|
||||
dev->rxp_timer = timer_new_us(QEMU_CLOCK_VIRTUAL, spapr_vlan_flush_rx_queue,
|
||||
diff --git a/hw/net/stellaris_enet.c b/hw/net/stellaris_enet.c
|
||||
index 8dd60783d8..6768a6912f 100644
|
||||
--- a/hw/net/stellaris_enet.c
|
||||
+++ b/hw/net/stellaris_enet.c
|
||||
@@ -492,7 +492,8 @@ static void stellaris_enet_realize(DeviceState *dev, Error **errp)
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
|
||||
s->nic = qemu_new_nic(&net_stellaris_enet_info, &s->conf,
|
||||
- object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
+ object_get_typename(OBJECT(dev)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
}
|
||||
|
||||
diff --git a/hw/net/sungem.c b/hw/net/sungem.c
|
||||
index 3684a4d733..c12d44e9dc 100644
|
||||
--- a/hw/net/sungem.c
|
||||
+++ b/hw/net/sungem.c
|
||||
@@ -1361,7 +1361,7 @@ static void sungem_realize(PCIDevice *pci_dev, Error **errp)
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_sungem_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)),
|
||||
- dev->id, s);
|
||||
+ dev->id, &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic),
|
||||
s->conf.macaddr.a);
|
||||
}
|
||||
diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c
|
||||
index fc34905f87..fa98528d71 100644
|
||||
--- a/hw/net/sunhme.c
|
||||
+++ b/hw/net/sunhme.c
|
||||
@@ -892,7 +892,8 @@ static void sunhme_realize(PCIDevice *pci_dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_sunhme_info, &s->conf,
|
||||
- object_get_typename(OBJECT(d)), d->id, s);
|
||||
+ object_get_typename(OBJECT(d)), d->id,
|
||||
+ &d->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
}
|
||||
|
||||
diff --git a/hw/net/tulip.c b/hw/net/tulip.c
|
||||
index ca69f7ea5e..985c4c14a4 100644
|
||||
--- a/hw/net/tulip.c
|
||||
+++ b/hw/net/tulip.c
|
||||
@@ -981,7 +981,8 @@ static void pci_tulip_realize(PCIDevice *pci_dev, Error **errp)
|
||||
|
||||
s->nic = qemu_new_nic(&net_tulip_info, &s->c,
|
||||
object_get_typename(OBJECT(pci_dev)),
|
||||
- pci_dev->qdev.id, s);
|
||||
+ pci_dev->qdev.id,
|
||||
+ &pci_dev->qdev.mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->c.macaddr.a);
|
||||
}
|
||||
|
||||
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
|
||||
index ddaa8fa122..f5f07f8e63 100644
|
||||
--- a/hw/net/virtio-net.c
|
||||
+++ b/hw/net/virtio-net.c
|
||||
@@ -3512,10 +3512,12 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
|
||||
* Happen when virtio_net_set_netclient_name has been called.
|
||||
*/
|
||||
n->nic = qemu_new_nic(&net_virtio_info, &n->nic_conf,
|
||||
- n->netclient_type, n->netclient_name, n);
|
||||
+ n->netclient_type, n->netclient_name,
|
||||
+ &dev->mem_reentrancy_guard, n);
|
||||
} else {
|
||||
n->nic = qemu_new_nic(&net_virtio_info, &n->nic_conf,
|
||||
- object_get_typename(OBJECT(dev)), dev->id, n);
|
||||
+ object_get_typename(OBJECT(dev)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, n);
|
||||
}
|
||||
|
||||
for (i = 0; i < n->max_queue_pairs; i++) {
|
||||
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
|
||||
index f65af4e9ef..d4df039c55 100644
|
||||
--- a/hw/net/vmxnet3.c
|
||||
+++ b/hw/net/vmxnet3.c
|
||||
@@ -2078,7 +2078,7 @@ static void vmxnet3_net_init(VMXNET3State *s)
|
||||
|
||||
s->nic = qemu_new_nic(&net_vmxnet3_info, &s->conf,
|
||||
object_get_typename(OBJECT(s)),
|
||||
- d->id, s);
|
||||
+ d->id, &d->mem_reentrancy_guard, s);
|
||||
|
||||
s->peer_has_vhdr = vmxnet3_peer_has_vnet_hdr(s);
|
||||
s->tx_sop = true;
|
||||
diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c
|
||||
index 5c815b4f0c..3d0b7820d3 100644
|
||||
--- a/hw/net/xen_nic.c
|
||||
+++ b/hw/net/xen_nic.c
|
||||
@@ -294,7 +294,8 @@ static int net_init(struct XenLegacyDevice *xendev)
|
||||
}
|
||||
|
||||
netdev->nic = qemu_new_nic(&net_xen_info, &netdev->conf,
|
||||
- "xen", NULL, netdev);
|
||||
+ "xen", NULL,
|
||||
+ &xendev->qdev.mem_reentrancy_guard, netdev);
|
||||
|
||||
snprintf(qemu_get_queue(netdev->nic)->info_str,
|
||||
sizeof(qemu_get_queue(netdev->nic)->info_str),
|
||||
diff --git a/hw/net/xgmac.c b/hw/net/xgmac.c
|
||||
index 0ab6ae91aa..1f4f277d84 100644
|
||||
--- a/hw/net/xgmac.c
|
||||
+++ b/hw/net/xgmac.c
|
||||
@@ -402,7 +402,8 @@ static void xgmac_enet_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_xgmac_enet_info, &s->conf,
|
||||
- object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
+ object_get_typename(OBJECT(dev)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
|
||||
s->regs[XGMAC_ADDR_HIGH(0)] = (s->conf.macaddr.a[5] << 8) |
|
||||
diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c
|
||||
index 990ff3a1c2..8a34243803 100644
|
||||
--- a/hw/net/xilinx_axienet.c
|
||||
+++ b/hw/net/xilinx_axienet.c
|
||||
@@ -968,7 +968,8 @@ static void xilinx_enet_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_xilinx_enet_info, &s->conf,
|
||||
- object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
+ object_get_typename(OBJECT(dev)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
|
||||
tdk_init(&s->TEMAC.phy);
|
||||
diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c
|
||||
index 6e09f7e422..80cb869e22 100644
|
||||
--- a/hw/net/xilinx_ethlite.c
|
||||
+++ b/hw/net/xilinx_ethlite.c
|
||||
@@ -235,7 +235,8 @@ static void xilinx_ethlite_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_xilinx_ethlite_info, &s->conf,
|
||||
- object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
+ object_get_typename(OBJECT(dev)), dev->id,
|
||||
+ &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
}
|
||||
|
||||
diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c
|
||||
index 6c49c16015..ae447a8bc3 100644
|
||||
--- a/hw/usb/dev-network.c
|
||||
+++ b/hw/usb/dev-network.c
|
||||
@@ -1362,7 +1362,8 @@ static void usb_net_realize(USBDevice *dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_usbnet_info, &s->conf,
|
||||
- object_get_typename(OBJECT(s)), s->dev.qdev.id, s);
|
||||
+ object_get_typename(OBJECT(s)), s->dev.qdev.id,
|
||||
+ &s->dev.qdev.mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
snprintf(s->usbstring_mac, sizeof(s->usbstring_mac),
|
||||
"%02x%02x%02x%02x%02x%02x",
|
||||
diff --git a/include/net/net.h b/include/net/net.h
|
||||
index 523136c7ac..1457b6c014 100644
|
||||
--- a/include/net/net.h
|
||||
+++ b/include/net/net.h
|
||||
@@ -145,6 +145,7 @@ NICState *qemu_new_nic(NetClientInfo *info,
|
||||
NICConf *conf,
|
||||
const char *model,
|
||||
const char *name,
|
||||
+ MemReentrancyGuard *reentrancy_guard,
|
||||
void *opaque);
|
||||
void qemu_del_nic(NICState *nic);
|
||||
NetClientState *qemu_get_subqueue(NICState *nic, int queue_index);
|
||||
diff --git a/net/net.c b/net/net.c
|
||||
index f0d14dbfc1..669e194c4b 100644
|
||||
--- a/net/net.c
|
||||
+++ b/net/net.c
|
||||
@@ -299,6 +299,7 @@ NICState *qemu_new_nic(NetClientInfo *info,
|
||||
NICConf *conf,
|
||||
const char *model,
|
||||
const char *name,
|
||||
+ MemReentrancyGuard *reentrancy_guard,
|
||||
void *opaque)
|
||||
{
|
||||
NetClientState **peers = conf->peers.ncs;
|
||||
--
|
||||
2.41.0
|
||||
|
105
kvm-net-Update-MemReentrancyGuard-for-NIC.patch
Normal file
105
kvm-net-Update-MemReentrancyGuard-for-NIC.patch
Normal file
@ -0,0 +1,105 @@
|
||||
From d58671091daf8c325a6f1cd87737d94b5fb51d12 Mon Sep 17 00:00:00 2001
|
||||
From: Jon Maloy <jmaloy@redhat.com>
|
||||
Date: Thu, 23 Nov 2023 11:30:46 -0500
|
||||
Subject: [PATCH 2/4] net: Update MemReentrancyGuard for NIC
|
||||
|
||||
RH-Author: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-MergeRequest: 331: net: Provide MemReentrancyGuard * to qemu_new_nic()
|
||||
RH-Jira: RHEL-7309
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
|
||||
RH-Acked-by: Jason Wang <jasowang@redhat.com>
|
||||
RH-Commit: [2/2] b116efe725dd838c2cab9bd2240112f3c6c46d6a (redhat/rhel/src/qemu-kvm/jons-qemu-kvm-2)
|
||||
|
||||
Jira: https://issues.redhat.com/browse/RHEL-7309
|
||||
CVE: CVE-2023-3019
|
||||
Upstream: Merged
|
||||
|
||||
commit 9050f976e447444ea6ee2ba12c9f77e4b0dc54bc
|
||||
Author: Akihiko Odaki <akihiko.odaki@daynix.com>
|
||||
Date: Thu Jun 1 12:18:59 2023 +0900
|
||||
|
||||
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>
|
||||
|
||||
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
|
||||
---
|
||||
include/net/net.h | 1 +
|
||||
net/net.c | 14 ++++++++++++++
|
||||
2 files changed, 15 insertions(+)
|
||||
|
||||
diff --git a/include/net/net.h b/include/net/net.h
|
||||
index 1457b6c014..11d4564ea1 100644
|
||||
--- a/include/net/net.h
|
||||
+++ b/include/net/net.h
|
||||
@@ -112,6 +112,7 @@ struct NetClientState {
|
||||
typedef struct NICState {
|
||||
NetClientState *ncs;
|
||||
NICConf *conf;
|
||||
+ MemReentrancyGuard *reentrancy_guard;
|
||||
void *opaque;
|
||||
bool peer_deleted;
|
||||
} NICState;
|
||||
diff --git a/net/net.c b/net/net.c
|
||||
index 669e194c4b..b3008a52b7 100644
|
||||
--- a/net/net.c
|
||||
+++ b/net/net.c
|
||||
@@ -312,6 +312,7 @@ NICState *qemu_new_nic(NetClientInfo *info,
|
||||
nic = g_malloc0(info->size + sizeof(NetClientState) * queues);
|
||||
nic->ncs = (void *)nic + info->size;
|
||||
nic->conf = conf;
|
||||
+ nic->reentrancy_guard = reentrancy_guard,
|
||||
nic->opaque = opaque;
|
||||
|
||||
for (i = 0; i < queues; i++) {
|
||||
@@ -767,6 +768,7 @@ static ssize_t qemu_deliver_packet_iov(NetClientState *sender,
|
||||
int iovcnt,
|
||||
void *opaque)
|
||||
{
|
||||
+ MemReentrancyGuard *owned_reentrancy_guard;
|
||||
NetClientState *nc = opaque;
|
||||
int ret;
|
||||
|
||||
@@ -779,12 +781,24 @@ static ssize_t qemu_deliver_packet_iov(NetClientState *sender,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ if (nc->info->type != NET_CLIENT_DRIVER_NIC ||
|
||||
+ qemu_get_nic(nc)->reentrancy_guard->engaged_in_io) {
|
||||
+ owned_reentrancy_guard = NULL;
|
||||
+ } else {
|
||||
+ owned_reentrancy_guard = qemu_get_nic(nc)->reentrancy_guard;
|
||||
+ owned_reentrancy_guard->engaged_in_io = true;
|
||||
+ }
|
||||
+
|
||||
if (nc->info->receive_iov && !(flags & QEMU_NET_PACKET_FLAG_RAW)) {
|
||||
ret = nc->info->receive_iov(nc, iov, iovcnt);
|
||||
} else {
|
||||
ret = nc_sendv_compat(nc, iov, iovcnt, flags);
|
||||
}
|
||||
|
||||
+ if (owned_reentrancy_guard) {
|
||||
+ owned_reentrancy_guard->engaged_in_io = false;
|
||||
+ }
|
||||
+
|
||||
if (ret == 0) {
|
||||
nc->receive_disabled = 1;
|
||||
}
|
||||
--
|
||||
2.41.0
|
||||
|
55
kvm-ui-fix-crash-when-there-are-no-active_console.patch
Normal file
55
kvm-ui-fix-crash-when-there-are-no-active_console.patch
Normal file
@ -0,0 +1,55 @@
|
||||
From 8a233fd50c4ab973ef4a3c4ac7daf83e5c90aabc Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
|
||||
Date: Mon, 11 Sep 2023 18:04:47 +0400
|
||||
Subject: [PATCH 4/4] ui: fix crash when there are no active_console
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
RH-MergeRequest: 338: ui: fix crash when there are no active_console
|
||||
RH-Jira: RHEL-2600
|
||||
RH-Acked-by: Gerd Hoffmann <None>
|
||||
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
|
||||
RH-Commit: [1/1] c58d1d76558dbc7ee2a8193a1e7a9b87a79ac385
|
||||
|
||||
JIRA: https://issues.redhat.com/browse/RHEL-2600
|
||||
|
||||
Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
|
||||
0x0000555555888630 in dpy_ui_info_supported (con=0x0) at ../ui/console.c:812
|
||||
812 return con->hw_ops->ui_info != NULL;
|
||||
(gdb) bt
|
||||
#0 0x0000555555888630 in dpy_ui_info_supported (con=0x0) at ../ui/console.c:812
|
||||
#1 0x00005555558a44b1 in protocol_client_msg (vs=0x5555578c76c0, data=0x5555581e93f0 <incomplete sequence \373>, len=24) at ../ui/vnc.c:2585
|
||||
#2 0x00005555558a19ac in vnc_client_read (vs=0x5555578c76c0) at ../ui/vnc.c:1607
|
||||
#3 0x00005555558a1ac2 in vnc_client_io (ioc=0x5555581eb0e0, condition=G_IO_IN, opaque=0x5555578c76c0) at ../ui/vnc.c:1635
|
||||
|
||||
Fixes:
|
||||
https://issues.redhat.com/browse/RHEL-2600
|
||||
|
||||
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Reviewed-by: Albert Esteve <aesteve@redhat.com>
|
||||
|
||||
(cherry picked from commit 48a35e12faf90a896c5aa4755812201e00d60316)
|
||||
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
---
|
||||
ui/console.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/ui/console.c b/ui/console.c
|
||||
index 29a3e3f0f5..df3426bd8a 100644
|
||||
--- a/ui/console.c
|
||||
+++ b/ui/console.c
|
||||
@@ -1525,6 +1525,9 @@ bool dpy_ui_info_supported(QemuConsole *con)
|
||||
if (con == NULL) {
|
||||
con = active_console;
|
||||
}
|
||||
+ if (con == NULL) {
|
||||
+ return false;
|
||||
+ }
|
||||
|
||||
return con->hw_ops->ui_info != NULL;
|
||||
}
|
||||
--
|
||||
2.41.0
|
||||
|
69
kvm-vhost-release-memory_listener-object-in-error-path.patch
Normal file
69
kvm-vhost-release-memory_listener-object-in-error-path.patch
Normal file
@ -0,0 +1,69 @@
|
||||
From a728c0b522997e8e63bf6b64b202a7ae48693d02 Mon Sep 17 00:00:00 2001
|
||||
From: Prasad Pandit <ppandit@redhat.com>
|
||||
Date: Fri, 18 Aug 2023 16:38:12 +0530
|
||||
Subject: [PATCH 3/4] vhost: release memory_listener object in error path
|
||||
|
||||
RH-Author: Prasad Pandit <None>
|
||||
RH-MergeRequest: 337: vhost: release memory_listener object in error path
|
||||
RH-Jira: RHEL-7567
|
||||
RH-Acked-by: Peter Xu <peterx@redhat.com>
|
||||
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-Commit: [1/1] 1e377a2f6f148e11a452d11107d839521354e2ca
|
||||
|
||||
Jira: https://issues.redhat.com/browse/RHEL-7567
|
||||
|
||||
commit 1e3ffb34f764f8ac4c003b2b2e6a775b2b073a16
|
||||
Author: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
Date: Mon May 29 17:13:32 2023 +0530
|
||||
|
||||
vhost: release memory_listener object in error path
|
||||
|
||||
vhost_dev_start function does not release memory_listener object
|
||||
in case of an error. This may crash the guest when vhost is unable
|
||||
to set memory table:
|
||||
|
||||
stack trace of thread 125653:
|
||||
Program terminated with signal SIGSEGV, Segmentation fault
|
||||
#0 memory_listener_register (qemu-kvm + 0x6cda0f)
|
||||
#1 vhost_dev_start (qemu-kvm + 0x699301)
|
||||
#2 vhost_net_start (qemu-kvm + 0x45b03f)
|
||||
#3 virtio_net_set_status (qemu-kvm + 0x665672)
|
||||
#4 qmp_set_link (qemu-kvm + 0x548fd5)
|
||||
#5 net_vhost_user_event (qemu-kvm + 0x552c45)
|
||||
#6 tcp_chr_connect (qemu-kvm + 0x88d473)
|
||||
#7 tcp_chr_new_client (qemu-kvm + 0x88cf83)
|
||||
#8 tcp_chr_accept (qemu-kvm + 0x88b429)
|
||||
#9 qio_net_listener_channel_func (qemu-kvm + 0x7ac07c)
|
||||
#10 g_main_context_dispatch (libglib-2.0.so.0 + 0x54e2f)
|
||||
|
||||
Release memory_listener objects in the error path.
|
||||
|
||||
Signed-off-by: Prasad Pandit <pjp@fedoraproject.org>
|
||||
Message-Id: <20230529114333.31686-2-ppandit@redhat.com>
|
||||
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
||||
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
||||
Reviewed-by: Peter Xu <peterx@redhat.com>
|
||||
Fixes: c471ad0e9b ("vhost_net: device IOTLB support")
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Acked-by: Jason Wang <jasowang@redhat.com>
|
||||
---
|
||||
hw/virtio/vhost.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
|
||||
index 437347ad01..639029aa76 100644
|
||||
--- a/hw/virtio/vhost.c
|
||||
+++ b/hw/virtio/vhost.c
|
||||
@@ -1818,6 +1818,9 @@ fail_vq:
|
||||
}
|
||||
|
||||
fail_mem:
|
||||
+ if (vhost_dev_has_iommu(hdev)) {
|
||||
+ memory_listener_unregister(&hdev->iommu_listener);
|
||||
+ }
|
||||
fail_features:
|
||||
|
||||
hdev->started = false;
|
||||
--
|
||||
2.41.0
|
||||
|
@ -83,7 +83,7 @@ Obsoletes: %1-rhev <= %{epoch}:%{version}-%{release}
|
||||
Summary: QEMU is a machine emulator and virtualizer
|
||||
Name: qemu-kvm
|
||||
Version: 6.2.0
|
||||
Release: 42%{?rcrel}%{?dist}
|
||||
Release: 43%{?rcrel}%{?dist}
|
||||
# Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped
|
||||
Epoch: 15
|
||||
License: GPLv2 and GPLv2+ and CC-BY
|
||||
@ -799,6 +799,14 @@ Patch318: kvm-target-s390x-dump-Remove-unneeded-dump-info-function.patch
|
||||
Patch319: kvm-dump-Add-arch-cleanup-function.patch
|
||||
# For RHEL-16696 - RHEL8 - KVM : Secure execution guest remains in "paused" state, post "virsh dump" failure (qemu-kvm)
|
||||
Patch320: kvm-target-s390x-arch_dump-Add-arch-cleanup-function-for.patch
|
||||
# For RHEL-7309 - CVE-2023-3019 virt:rhel/qemu-kvm: QEMU: e1000e: heap use-after-free in e1000e_write_packet_to_guest() [rhel-8]
|
||||
Patch321: kvm-net-Provide-MemReentrancyGuard-to-qemu_new_nic.patch
|
||||
# For RHEL-7309 - CVE-2023-3019 virt:rhel/qemu-kvm: QEMU: e1000e: heap use-after-free in e1000e_write_packet_to_guest() [rhel-8]
|
||||
Patch322: kvm-net-Update-MemReentrancyGuard-for-NIC.patch
|
||||
# For RHEL-7567 - [RHEL8][clone]VM crash when guest running testpmd and delete created vhostuserclient port on host
|
||||
Patch323: kvm-vhost-release-memory_listener-object-in-error-path.patch
|
||||
# For RHEL-2600 - qemu core dump occurs when client connects to VNC server because qemu cmd only adds vnc but without graphics device
|
||||
Patch324: kvm-ui-fix-crash-when-there-are-no-active_console.patch
|
||||
|
||||
BuildRequires: wget
|
||||
BuildRequires: rpm-build
|
||||
@ -1968,6 +1976,18 @@ sh %{_sysconfdir}/sysconfig/modules/kvm.modules &> /dev/null || :
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Dec 06 2023 Jon Maloy <jmaloy@redhat.com> - 6.2.0-43
|
||||
- kvm-net-Provide-MemReentrancyGuard-to-qemu_new_nic.patch [RHEL-7309]
|
||||
- kvm-net-Update-MemReentrancyGuard-for-NIC.patch [RHEL-7309]
|
||||
- kvm-vhost-release-memory_listener-object-in-error-path.patch [RHEL-7567]
|
||||
- kvm-ui-fix-crash-when-there-are-no-active_console.patch [RHEL-2600]
|
||||
- Resolves: RHEL-7309
|
||||
(CVE-2023-3019 virt:rhel/qemu-kvm: QEMU: e1000e: heap use-after-free in e1000e_write_packet_to_guest() [rhel-8])
|
||||
- Resolves: RHEL-7567
|
||||
([RHEL8][clone]VM crash when guest running testpmd and delete created vhostuserclient port on host)
|
||||
- Resolves: RHEL-2600
|
||||
(qemu core dump occurs when client connects to VNC server because qemu cmd only adds vnc but without graphics device)
|
||||
|
||||
* Thu Nov 23 2023 Miroslav Rezanina <mrezanin@redhat.com> - 6.2.0-42
|
||||
- kvm-target-s390x-dump-Remove-unneeded-dump-info-function.patch [RHEL-16696]
|
||||
- kvm-dump-Add-arch-cleanup-function.patch [RHEL-16696]
|
||||
|
Loading…
Reference in New Issue
Block a user