summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/connman/connman/CVE-2022-23098.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/connman/connman/CVE-2022-23098.patch')
-rw-r--r--meta/recipes-connectivity/connman/connman/CVE-2022-23098.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/connman/connman/CVE-2022-23098.patch b/meta/recipes-connectivity/connman/connman/CVE-2022-23098.patch
new file mode 100644
index 0000000000..a40c9f583f
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman/CVE-2022-23098.patch
@@ -0,0 +1,50 @@
1From d8708b85c1e8fe25af7803e8a20cf20e7201d8a4 Mon Sep 17 00:00:00 2001
2From: Matthias Gerstner <mgerstner@suse.de>
3Date: Tue, 25 Jan 2022 10:00:25 +0100
4Subject: dnsproxy: Avoid 100 % busy loop in TCP server case
5
6Once the TCP socket is connected and until the remote server is
7responding (if ever) ConnMan executes a 100 % CPU loop, since
8the connected socket will always be writable (G_IO_OUT).
9
10To fix this, modify the watch after the connection is established to
11remove the G_IO_OUT from the callback conditions.
12
13Fixes: CVE-2022-23098
14
15Upstream-Status: Backport
16https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=d8708b85c1e8fe25af7803e8a20cf20e7201d8a4
17
18CVE: CVE-2022-23098
19Signed-off-by: Steve Sakoman <steve@sakoman.com>
20
21---
22 src/dnsproxy.c | 12 ++++++++++++
23 1 file changed, 12 insertions(+)
24
25diff --git a/src/dnsproxy.c b/src/dnsproxy.c
26index c027bcb9..1ccf36a9 100644
27--- a/src/dnsproxy.c
28+++ b/src/dnsproxy.c
29@@ -2360,6 +2360,18 @@ hangup:
30 }
31 }
32
33+ /*
34+ * Remove the G_IO_OUT flag from the watch, otherwise we end
35+ * up in a busy loop, because the socket is constantly writable.
36+ *
37+ * There seems to be no better way in g_io to do that than
38+ * re-adding the watch.
39+ */
40+ g_source_remove(server->watch);
41+ server->watch = g_io_add_watch(server->channel,
42+ G_IO_IN | G_IO_HUP | G_IO_NVAL | G_IO_ERR,
43+ tcp_server_event, server);
44+
45 server->connected = true;
46 server_list = g_slist_append(server_list, server);
47
48--
49cgit 1.2.3-1.el7
50