Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10e74b75cb | ||
|
|
67283bdf89 | ||
|
|
e092293a63 | ||
|
|
41a6b3c03f | ||
|
|
31256f3d0d | ||
|
|
abac39a1b8 | ||
|
|
39e9be886f | ||
|
|
3db4281bc0 | ||
|
|
249ba7e495 | ||
|
|
33a8555d08 | ||
|
|
dfb6f9eee6 | ||
|
|
f5c4597c0a | ||
|
|
766bb232e8 | ||
|
|
266d5e2fcb | ||
|
|
c6cfdf3963 | ||
|
|
e3da3b01fc | ||
|
|
b340367499 | ||
|
|
ca7cc971b8 | ||
|
|
774125b7ed | ||
|
|
afd39d2091 | ||
|
|
cc16b7cd3a | ||
|
|
be942ea860 | ||
|
|
938b89f090 | ||
|
|
f7283923a3 | ||
|
|
1ad100593a | ||
|
|
21608be3b1 | ||
|
|
6347aef63f | ||
|
|
1c5d25ffeb | ||
|
|
8386ba3e9d | ||
|
|
03d3983515 | ||
|
|
1b0f3aaf64 | ||
|
|
647354eaf9 | ||
|
|
1392d7120d | ||
|
|
f80d27e126 | ||
|
|
63cd2ced20 | ||
|
|
cad1b6966f | ||
|
|
a27f478451 | ||
|
|
b94faf01a5 | ||
|
|
60a70c925a | ||
|
|
e184d967ac | ||
|
|
985ee7390d | ||
|
|
156ce5b5c7 | ||
|
|
77b02695ab | ||
|
|
50057212b3 | ||
|
|
c61c2c83ef | ||
|
|
e3e721c529 | ||
|
|
7bf08eb7cb | ||
|
|
0862e2b778 | ||
|
|
9ae002fc72 | ||
|
|
7749fc4a26 | ||
|
|
5b0f05f970 | ||
|
|
36079ddefa | ||
|
|
9abc69f078 |
@@ -0,0 +1,41 @@
|
|||||||
|
From 845210011a9ffd9d17e30c51cbc81ba67c5d3166 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
Date: Tue, 20 Jan 2026 10:08:29 +0100
|
||||||
|
Subject: [PATCH] esx: Allow connecting to IPv6 server
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
When connecting to a VMWare server, the hostname from URI is
|
||||||
|
resolved using esxUtil_ResolveHostname() which in turn calls
|
||||||
|
getaddrinfo(). But in the hints argument, we restrict the return
|
||||||
|
address to be IPv4 (AF_INET) which obviously fails if the address
|
||||||
|
to resolve is an IPv6 address. Set the hint to AF_UNSPEC which
|
||||||
|
allows both IPv4 and IPv6. While at it, also allow IPv4 addresses
|
||||||
|
mapped in IPv6 by setting AI_V4MAPPED flag.
|
||||||
|
|
||||||
|
Resolves: https://issues.redhat.com/browse/RHEL-138300
|
||||||
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||||
|
---
|
||||||
|
src/esx/esx_util.c | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/esx/esx_util.c b/src/esx/esx_util.c
|
||||||
|
index 88b3dc893f..a6275babd5 100644
|
||||||
|
--- a/src/esx/esx_util.c
|
||||||
|
+++ b/src/esx/esx_util.c
|
||||||
|
@@ -275,8 +275,8 @@ esxUtil_ResolveHostname(const char *hostname, char **ipAddress)
|
||||||
|
int errcode;
|
||||||
|
g_autofree char *address = NULL;
|
||||||
|
|
||||||
|
- hints.ai_flags = AI_ADDRCONFIG;
|
||||||
|
- hints.ai_family = AF_INET;
|
||||||
|
+ hints.ai_flags = AI_ADDRCONFIG | AI_V4MAPPED;
|
||||||
|
+ hints.ai_family = AF_UNSPEC;
|
||||||
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
|
hints.ai_protocol = 0;
|
||||||
|
|
||||||
|
--
|
||||||
|
2.52.0
|
||||||
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
From 3499354e12a1c1832bf4030693a64e03ceb79d05 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
|
|
||||||
Date: Wed, 5 Jun 2024 11:16:21 +0100
|
|
||||||
Subject: [PATCH] interface: fix udev reference leak with invalid flags
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
The udevInterfaceGetXMLDesc method takes a reference on the udev
|
|
||||||
driver as its first action. If the virCheckFlags() condition
|
|
||||||
fails, however, this reference is never released.
|
|
||||||
|
|
||||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
|
||||||
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
||||||
---
|
|
||||||
src/interface/interface_backend_udev.c | 4 +++-
|
|
||||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c
|
|
||||||
index fdf11a8318..e1a50389c9 100644
|
|
||||||
--- a/src/interface/interface_backend_udev.c
|
|
||||||
+++ b/src/interface/interface_backend_udev.c
|
|
||||||
@@ -1027,12 +1027,14 @@ static char *
|
|
||||||
udevInterfaceGetXMLDesc(virInterfacePtr ifinfo,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
- struct udev *udev = udev_ref(driver->udev);
|
|
||||||
+ struct udev *udev = NULL;
|
|
||||||
g_autoptr(virInterfaceDef) ifacedef = NULL;
|
|
||||||
char *xmlstr = NULL;
|
|
||||||
|
|
||||||
virCheckFlags(VIR_INTERFACE_XML_INACTIVE, NULL);
|
|
||||||
|
|
||||||
+ udev = udev_ref(driver->udev);
|
|
||||||
+
|
|
||||||
/* Recursively build up the interface XML based on the requested
|
|
||||||
* interface name
|
|
||||||
*/
|
|
||||||
--
|
|
||||||
2.45.1
|
|
||||||
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
From 98f1cf88fa7e0f992d93f376418fbfb3996a9690 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
|
|
||||||
Date: Fri, 17 May 2024 14:55:24 +0100
|
|
||||||
Subject: [PATCH] rpc: avoid leak of GSource in use for interrupting main loop
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
We never release the reference on the GSource created for
|
|
||||||
interrupting the main loop, nor do we remove it from the
|
|
||||||
main context if our thread is woken up prior to the wakeup
|
|
||||||
callback firing.
|
|
||||||
|
|
||||||
This can result in a leak of GSource objects, along with an
|
|
||||||
ever growing list of GSources attached to the main context,
|
|
||||||
which will gradually slow down execution of the loop, as
|
|
||||||
several operations are O(N) for the number of attached GSource
|
|
||||||
objects.
|
|
||||||
|
|
||||||
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
|
||||||
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
||||||
---
|
|
||||||
src/rpc/virnetclient.c | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
|
|
||||||
index 147b0d661a..6d424eb599 100644
|
|
||||||
--- a/src/rpc/virnetclient.c
|
|
||||||
+++ b/src/rpc/virnetclient.c
|
|
||||||
@@ -1946,7 +1946,7 @@ static int virNetClientIO(virNetClient *client,
|
|
||||||
/* Check to see if another thread is dispatching */
|
|
||||||
if (client->haveTheBuck) {
|
|
||||||
/* Force other thread to wakeup from poll */
|
|
||||||
- GSource *wakeup = g_idle_source_new();
|
|
||||||
+ g_autoptr(GSource) wakeup = g_idle_source_new();
|
|
||||||
g_source_set_callback(wakeup, virNetClientIOWakeup, client->eventLoop, NULL);
|
|
||||||
g_source_attach(wakeup, client->eventCtx);
|
|
||||||
|
|
||||||
@@ -1968,6 +1968,7 @@ static int virNetClientIO(virNetClient *client,
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ g_source_destroy(wakeup);
|
|
||||||
VIR_DEBUG("Woken up from sleep head=%p call=%p",
|
|
||||||
client->waitDispatch, thiscall);
|
|
||||||
/* Three reasons we can be woken up
|
|
||||||
--
|
|
||||||
2.45.1
|
|
||||||
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
From 8074d64dc2eca846d6a61efe1a9b7428a0ce1dd1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
|
|
||||||
Date: Tue, 30 Apr 2024 11:51:15 +0100
|
|
||||||
Subject: [PATCH] rpc: ensure temporary GSource is removed from client event
|
|
||||||
loop
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Users are seeing periodic segfaults from libvirt client apps,
|
|
||||||
especially thread heavy ones like virt-manager. A typical
|
|
||||||
stack trace would end up in the virNetClientIOEventFD method,
|
|
||||||
with illegal access to stale stack data. eg
|
|
||||||
|
|
||||||
==238721==ERROR: AddressSanitizer: stack-use-after-return on address 0x75cd18709788 at pc 0x75cd3111f907 bp 0x75cd181ff550 sp 0x75cd181ff548
|
|
||||||
WRITE of size 4 at 0x75cd18709788 thread T11
|
|
||||||
#0 0x75cd3111f906 in virNetClientIOEventFD /usr/src/debug/libvirt/libvirt-10.2.0/build/../src/rpc/virnetclient.c:1634:15
|
|
||||||
#1 0x75cd3210d198 (/usr/lib/libglib-2.0.so.0+0x5a198) (BuildId: 0a2311dfbbc6c215dc36f4b6bdd2b4b6fbae55a2)
|
|
||||||
#2 0x75cd3216c3be (/usr/lib/libglib-2.0.so.0+0xb93be) (BuildId: 0a2311dfbbc6c215dc36f4b6bdd2b4b6fbae55a2)
|
|
||||||
#3 0x75cd3210ddc6 in g_main_loop_run (/usr/lib/libglib-2.0.so.0+0x5adc6) (BuildId: 0a2311dfbbc6c215dc36f4b6bdd2b4b6fbae55a2)
|
|
||||||
#4 0x75cd3111a47c in virNetClientIOEventLoop /usr/src/debug/libvirt/libvirt-10.2.0/build/../src/rpc/virnetclient.c:1722:9
|
|
||||||
#5 0x75cd3111a47c in virNetClientIO /usr/src/debug/libvirt/libvirt-10.2.0/build/../src/rpc/virnetclient.c:2002:10
|
|
||||||
#6 0x75cd3111a47c in virNetClientSendInternal /usr/src/debug/libvirt/libvirt-10.2.0/build/../src/rpc/virnetclient.c:2170:11
|
|
||||||
#7 0x75cd311198a8 in virNetClientSendWithReply /usr/src/debug/libvirt/libvirt-10.2.0/build/../src/rpc/virnetclient.c:2198:11
|
|
||||||
#8 0x75cd31111653 in virNetClientProgramCall /usr/src/debug/libvirt/libvirt-10.2.0/build/../src/rpc/virnetclientprogram.c:318:9
|
|
||||||
#9 0x75cd31241c8f in callFull /usr/src/debug/libvirt/libvirt-10.2.0/build/../src/remote/remote_driver.c:6054:10
|
|
||||||
#10 0x75cd31241c8f in call /usr/src/debug/libvirt/libvirt-10.2.0/build/../src/remote/remote_driver.c:6076:12
|
|
||||||
#11 0x75cd31241c8f in remoteNetworkGetXMLDesc /usr/src/debug/libvirt/libvirt-10.2.0/build/src/remote/remote_client_bodies.h:5959:9
|
|
||||||
#12 0x75cd31410ff7 in virNetworkGetXMLDesc /usr/src/debug/libvirt/libvirt-10.2.0/build/../src/libvirt-network.c:952:15
|
|
||||||
|
|
||||||
The root cause is a bad assumption in the virNetClientIOEventLoop
|
|
||||||
method. This method is run by whichever thread currently owns the
|
|
||||||
buck, and is responsible for handling I/O. Inside a for(;;) loop,
|
|
||||||
this method creates a temporary GSource, adds it to the event loop
|
|
||||||
and runs g_main_loop_run(). When I/O is ready, the GSource callback
|
|
||||||
(virNetClientIOEventFD) will fire and call g_main_loop_quit(), and
|
|
||||||
return G_SOURCE_REMOVE which results in the temporary GSource being
|
|
||||||
destroyed. A g_autoptr() will then remove the last reference.
|
|
||||||
|
|
||||||
What was overlooked, is that a second thread can come along and
|
|
||||||
while it can't enter virNetClientIOEventLoop, it will register an
|
|
||||||
idle source that uses virNetClientIOWakeup to interrupt the
|
|
||||||
original thread's 'g_main_loop_run' call. When this happens the
|
|
||||||
virNetClientIOEventFD callback never runs, and so the temporary
|
|
||||||
GSource is not destroyed. The g_autoptr() will remove a reference,
|
|
||||||
but by virtue of still being attached to the event context, there
|
|
||||||
is an extra reference held causing GSource to be leaked. The
|
|
||||||
next time 'g_main_loop_run' is called, the original GSource will
|
|
||||||
trigger its callback, and access data that was allocated on the
|
|
||||||
stack by the previous thread, and likely SEGV.
|
|
||||||
|
|
||||||
To solve this, the thread calling 'g_main_loop_run' must call
|
|
||||||
g_source_destroy, immediately upon return, to guarantee that
|
|
||||||
the temporary GSource is removed.
|
|
||||||
|
|
||||||
CVE-2024-4418
|
|
||||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
||||||
Reported-by: Martin Shirokov <shirokovmartin@gmail.com>
|
|
||||||
Tested-by: Martin Shirokov <shirokovmartin@gmail.com>
|
|
||||||
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
||||||
---
|
|
||||||
src/rpc/virnetclient.c | 14 +++++++++++++-
|
|
||||||
1 file changed, 13 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
|
|
||||||
index 68098b1c8d..147b0d661a 100644
|
|
||||||
--- a/src/rpc/virnetclient.c
|
|
||||||
+++ b/src/rpc/virnetclient.c
|
|
||||||
@@ -1657,7 +1657,7 @@ static int virNetClientIOEventLoop(virNetClient *client,
|
|
||||||
#endif /* !WIN32 */
|
|
||||||
int timeout = -1;
|
|
||||||
virNetMessage *msg = NULL;
|
|
||||||
- g_autoptr(GSource) G_GNUC_UNUSED source = NULL;
|
|
||||||
+ g_autoptr(GSource) source = NULL;
|
|
||||||
GIOCondition ev = 0;
|
|
||||||
struct virNetClientIOEventData data = {
|
|
||||||
.client = client,
|
|
||||||
@@ -1721,6 +1721,18 @@ static int virNetClientIOEventLoop(virNetClient *client,
|
|
||||||
|
|
||||||
g_main_loop_run(client->eventLoop);
|
|
||||||
|
|
||||||
+ /*
|
|
||||||
+ * If virNetClientIOEventFD ran, this GSource will already be
|
|
||||||
+ * destroyed due to G_SOURCE_REMOVE. It is harmless to re-destroy
|
|
||||||
+ * it, since we still own a reference.
|
|
||||||
+ *
|
|
||||||
+ * If virNetClientIOWakeup ran, it will have interrupted the
|
|
||||||
+ * g_main_loop_run call, before virNetClientIOEventFD could
|
|
||||||
+ * run, and thus the GSource is still registered, and we need
|
|
||||||
+ * to destroy it since it is referencing stack memory for 'data'
|
|
||||||
+ */
|
|
||||||
+ g_source_destroy(source);
|
|
||||||
+
|
|
||||||
#ifndef WIN32
|
|
||||||
ignore_value(pthread_sigmask(SIG_SETMASK, &oldmask, NULL));
|
|
||||||
#endif /* !WIN32 */
|
|
||||||
--
|
|
||||||
2.45.1
|
|
||||||
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
From adfdb79f1e01401349e1321d0f5059d7b6489f00 Mon Sep 17 00:00:00 2001
|
|
||||||
Message-ID: <adfdb79f1e01401349e1321d0f5059d7b6489f00.1724763718.git.crobinso@redhat.com>
|
|
||||||
From: Martin Kletzander <mkletzan@redhat.com>
|
|
||||||
Date: Fri, 16 Aug 2024 13:56:51 +0200
|
|
||||||
Subject: [PATCH 1/3] virarptable: Properly calculate rtattr length
|
|
||||||
Content-type: text/plain
|
|
||||||
|
|
||||||
Use convenience macro which does almost the same thing we were doing,
|
|
||||||
but also pads out the payload length to a multiple of NLMSG_ALIGNTO (4)
|
|
||||||
bytes.
|
|
||||||
|
|
||||||
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
|
|
||||||
Reviewed-by: Laine Stump <laine@redhat.com>
|
|
||||||
Signed-off-by: Cole Robinson <crobinso@redhat.com>
|
|
||||||
---
|
|
||||||
src/util/virarptable.c | 3 +--
|
|
||||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/util/virarptable.c b/src/util/virarptable.c
|
|
||||||
index 299dddd664..d8e41c5a86 100644
|
|
||||||
--- a/src/util/virarptable.c
|
|
||||||
+++ b/src/util/virarptable.c
|
|
||||||
@@ -102,8 +102,7 @@ virArpTableGet(void)
|
|
||||||
return table;
|
|
||||||
|
|
||||||
VIR_WARNINGS_NO_CAST_ALIGN
|
|
||||||
- parse_rtattr(tb, NDA_MAX, NDA_RTA(r),
|
|
||||||
- nh->nlmsg_len - NLMSG_LENGTH(sizeof(*r)));
|
|
||||||
+ parse_rtattr(tb, NDA_MAX, NDA_RTA(r), NLMSG_PAYLOAD(nh, sizeof(*r)));
|
|
||||||
VIR_WARNINGS_RESET
|
|
||||||
|
|
||||||
if (tb[NDA_DST] == NULL || tb[NDA_LLADDR] == NULL)
|
|
||||||
--
|
|
||||||
2.46.0
|
|
||||||
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
From 137779b894858bd958ea575cec260a0559b31e48 Mon Sep 17 00:00:00 2001
|
|
||||||
Message-ID: <137779b894858bd958ea575cec260a0559b31e48.1724763718.git.crobinso@redhat.com>
|
|
||||||
In-Reply-To: <adfdb79f1e01401349e1321d0f5059d7b6489f00.1724763718.git.crobinso@redhat.com>
|
|
||||||
References: <adfdb79f1e01401349e1321d0f5059d7b6489f00.1724763718.git.crobinso@redhat.com>
|
|
||||||
From: Martin Kletzander <mkletzan@redhat.com>
|
|
||||||
Date: Fri, 16 Aug 2024 13:59:15 +0200
|
|
||||||
Subject: [PATCH 2/3] virarptable: Fix check for message length
|
|
||||||
Content-type: text/plain
|
|
||||||
|
|
||||||
The previous check was all wrong since it calculated the how long would
|
|
||||||
the netlink message be if the netlink header was the payload and then
|
|
||||||
subtracted that from the whole message length, a variable that was not
|
|
||||||
used later in the code. This check can fail if there are no additional
|
|
||||||
payloads, struct rtattr in particular, which we are parsing later,
|
|
||||||
however the RTA_OK macro would've caught that anyway.
|
|
||||||
|
|
||||||
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
|
|
||||||
Reviewed-by: Laine Stump <laine@redhat.com>
|
|
||||||
Signed-off-by: Cole Robinson <crobinso@redhat.com>
|
|
||||||
---
|
|
||||||
src/util/virarptable.c | 3 +--
|
|
||||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/util/virarptable.c b/src/util/virarptable.c
|
|
||||||
index d8e41c5a86..45ee76766f 100644
|
|
||||||
--- a/src/util/virarptable.c
|
|
||||||
+++ b/src/util/virarptable.c
|
|
||||||
@@ -81,10 +81,9 @@ virArpTableGet(void)
|
|
||||||
for (; NLMSG_OK(nh, msglen); nh = NLMSG_NEXT(nh, msglen)) {
|
|
||||||
VIR_WARNINGS_RESET
|
|
||||||
struct ndmsg *r = NLMSG_DATA(nh);
|
|
||||||
- int len = nh->nlmsg_len;
|
|
||||||
void *addr;
|
|
||||||
|
|
||||||
- if ((len -= NLMSG_LENGTH(sizeof(*nh))) < 0) {
|
|
||||||
+ if (nh->nlmsg_len < NLMSG_SPACE(sizeof(*r))) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||||
_("wrong nlmsg len"));
|
|
||||||
goto cleanup;
|
|
||||||
--
|
|
||||||
2.46.0
|
|
||||||
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
From df2cefb31dab2fa56e0864fbd2b8ad468dee22c0 Mon Sep 17 00:00:00 2001
|
|
||||||
Message-ID: <df2cefb31dab2fa56e0864fbd2b8ad468dee22c0.1724763718.git.crobinso@redhat.com>
|
|
||||||
In-Reply-To: <adfdb79f1e01401349e1321d0f5059d7b6489f00.1724763718.git.crobinso@redhat.com>
|
|
||||||
References: <adfdb79f1e01401349e1321d0f5059d7b6489f00.1724763718.git.crobinso@redhat.com>
|
|
||||||
From: Martin Kletzander <mkletzan@redhat.com>
|
|
||||||
Date: Fri, 16 Aug 2024 14:02:48 +0200
|
|
||||||
Subject: [PATCH 3/3] virarptable: End parsing earlier in case of NLMSG_DONE
|
|
||||||
Content-type: text/plain
|
|
||||||
|
|
||||||
Check for the last multipart message right as the first thing. The
|
|
||||||
presumption probably was that the last message might still contain a
|
|
||||||
payload we want to parse. However that cannot be true since that would
|
|
||||||
have to be a type RTM_NEWNEIGH. This was not caught because older
|
|
||||||
kernels were note sending NLMSG_DONE and probably relied on the fact
|
|
||||||
that the parsing just stops after all the messages are walked through,
|
|
||||||
which the NLMSG_OK macro successfully did.
|
|
||||||
|
|
||||||
Resolves: https://issues.redhat.com/browse/RHEL-52449
|
|
||||||
Resolves: https://bugzilla.redhat.com/2302245
|
|
||||||
Fixes: a176d67cdfaf5b8237a7e3a80d8be0e6bdf2d8fd
|
|
||||||
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
|
|
||||||
Reviewed-by: Laine Stump <laine@redhat.com>
|
|
||||||
Signed-off-by: Cole Robinson <crobinso@redhat.com>
|
|
||||||
---
|
|
||||||
src/util/virarptable.c | 6 +++---
|
|
||||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/util/virarptable.c b/src/util/virarptable.c
|
|
||||||
index 45ee76766f..20d11f97b0 100644
|
|
||||||
--- a/src/util/virarptable.c
|
|
||||||
+++ b/src/util/virarptable.c
|
|
||||||
@@ -83,6 +83,9 @@ virArpTableGet(void)
|
|
||||||
struct ndmsg *r = NLMSG_DATA(nh);
|
|
||||||
void *addr;
|
|
||||||
|
|
||||||
+ if (nh->nlmsg_type == NLMSG_DONE)
|
|
||||||
+ break;
|
|
||||||
+
|
|
||||||
if (nh->nlmsg_len < NLMSG_SPACE(sizeof(*r))) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||||
_("wrong nlmsg len"));
|
|
||||||
@@ -97,9 +100,6 @@ virArpTableGet(void)
|
|
||||||
(!(r->ndm_state == NUD_STALE || r->ndm_state == NUD_REACHABLE)))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
- if (nh->nlmsg_type == NLMSG_DONE)
|
|
||||||
- return table;
|
|
||||||
-
|
|
||||||
VIR_WARNINGS_NO_CAST_ALIGN
|
|
||||||
parse_rtattr(tb, NDA_MAX, NDA_RTA(r), NLMSG_PAYLOAD(nh, sizeof(*r)));
|
|
||||||
VIR_WARNINGS_RESET
|
|
||||||
--
|
|
||||||
2.46.0
|
|
||||||
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
From 4c5b2e1e0d0d0cbbf8c6ed28ce77d055d5974f7f Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
|
|
||||||
Date: Wed, 6 Mar 2024 17:26:40 +0100
|
|
||||||
Subject: [PATCH] qemu: virtiofs: set correct label when creating the socket
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Use svirt_t instead of virtd_t, since virtd_t is not available in the
|
|
||||||
session mode and qemu with svirt_t won't be able to talk to unconfined_t
|
|
||||||
socket.
|
|
||||||
|
|
||||||
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
|
||||||
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
|
||||||
---
|
|
||||||
src/qemu/qemu_virtiofs.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c
|
|
||||||
index 15dea3bb57f..d80cddd3ba9 100644
|
|
||||||
--- a/src/qemu/qemu_virtiofs.c
|
|
||||||
+++ b/src/qemu/qemu_virtiofs.c
|
|
||||||
@@ -102,7 +102,7 @@ qemuVirtioFSOpenChardev(virQEMUDriver *driver,
|
|
||||||
chrdev->data.nix.listen = true;
|
|
||||||
chrdev->data.nix.path = g_strdup(socket_path);
|
|
||||||
|
|
||||||
- if (qemuSecuritySetDaemonSocketLabel(driver->securityManager, vm->def) < 0)
|
|
||||||
+ if (qemuSecuritySetSocketLabel(driver->securityManager, vm->def) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
fd = qemuOpenChrChardevUNIXSocket(chrdev);
|
|
||||||
if (fd < 0) {
|
|
||||||
+352
-132
File diff suppressed because it is too large
Load Diff
@@ -1 +1 @@
|
|||||||
SHA512 (libvirt-10.1.0.tar.xz) = 08e73ae15de5681430b62db85ec9901242dca5e9a4ca9685614f4a67092c6e28f27f9187144b3ceb18ad6b40e6eb1a90b1a4b056b0888724d04a62002ee2bc48
|
SHA512 (libvirt-12.0.0.tar.xz) = 5613e4e59865f688fe4cca2734c6de1cf68d0540c6e3013c9c21e583accd4f4fc21ec98e9c794036c5d6d0c8dd05ad1d22dab61f8c7d2934c8cb507b5bee76ad
|
||||||
|
|||||||
Reference in New Issue
Block a user