summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2021-06-14 11:54:36 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-06-17 00:07:05 +0100
commit2dc2bb9191558613404992a0d802af0852b49a3c (patch)
treedfbadb53fef198c902ce36bb9d9221139b4b33ac /meta/recipes-connectivity
parent2097f35eba7fd004344fb2e3e71d2a1bca55ea67 (diff)
downloadpoky-2dc2bb9191558613404992a0d802af0852b49a3c.tar.gz
avahi: apply fix for CVE-2021-3468
This patch isn't yet upstream but it has been submitted and other distros are shipping it. (From OE-Core rev: ea33a4a2df4600a55b268e9d57e7396c30f3d123) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity')
-rw-r--r--meta/recipes-connectivity/avahi/avahi_0.8.bb1
-rw-r--r--meta/recipes-connectivity/avahi/files/handle-hup.patch41
2 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/avahi/avahi_0.8.bb b/meta/recipes-connectivity/avahi/avahi_0.8.bb
index 5c46bbf58e..4302310888 100644
--- a/meta/recipes-connectivity/avahi/avahi_0.8.bb
+++ b/meta/recipes-connectivity/avahi/avahi_0.8.bb
@@ -24,6 +24,7 @@ SRC_URI = "https://github.com/lathiat/avahi/releases/download/v${PV}/avahi-${PV}
24 file://99avahi-autoipd \ 24 file://99avahi-autoipd \
25 file://initscript.patch \ 25 file://initscript.patch \
26 file://0001-Fix-opening-etc-resolv.conf-error.patch \ 26 file://0001-Fix-opening-etc-resolv.conf-error.patch \
27 file://handle-hup.patch \
27 " 28 "
28 29
29UPSTREAM_CHECK_URI = "https://github.com/lathiat/avahi/releases/" 30UPSTREAM_CHECK_URI = "https://github.com/lathiat/avahi/releases/"
diff --git a/meta/recipes-connectivity/avahi/files/handle-hup.patch b/meta/recipes-connectivity/avahi/files/handle-hup.patch
new file mode 100644
index 0000000000..26632e5443
--- /dev/null
+++ b/meta/recipes-connectivity/avahi/files/handle-hup.patch
@@ -0,0 +1,41 @@
1CVE: CVE-2021-3468
2Upstream-Status: Submitted [https://github.com/lathiat/avahi/pull/330]
3Signed-off-by: Ross Burton <ross.burton@arm.com>
4
5From 447affe29991ee99c6b9732fc5f2c1048a611d3b Mon Sep 17 00:00:00 2001
6From: Riccardo Schirone <sirmy15@gmail.com>
7Date: Fri, 26 Mar 2021 11:50:24 +0100
8Subject: [PATCH] Avoid infinite-loop in avahi-daemon by handling HUP event in
9 client_work
10
11If a client fills the input buffer, client_work() disables the
12AVAHI_WATCH_IN event, thus preventing the function from executing the
13`read` syscall the next times it is called. However, if the client then
14terminates the connection, the socket file descriptor receives a HUP
15event, which is not handled, thus the kernel keeps marking the HUP event
16as occurring. While iterating over the file descriptors that triggered
17an event, the client file descriptor will keep having the HUP event and
18the client_work() function is always called with AVAHI_WATCH_HUP but
19without nothing being done, thus entering an infinite loop.
20
21See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=984938
22---
23 avahi-daemon/simple-protocol.c | 5 +++++
24 1 file changed, 5 insertions(+)
25
26diff --git a/avahi-daemon/simple-protocol.c b/avahi-daemon/simple-protocol.c
27index 3e0ebb11..6c0274d6 100644
28--- a/avahi-daemon/simple-protocol.c
29+++ b/avahi-daemon/simple-protocol.c
30@@ -424,6 +424,11 @@ static void client_work(AvahiWatch *watch, AVAHI_GCC_UNUSED int fd, AvahiWatchEv
31 }
32 }
33
34+ if (events & AVAHI_WATCH_HUP) {
35+ client_free(c);
36+ return;
37+ }
38+
39 c->server->poll_api->watch_update(
40 watch,
41 (c->outbuf_length > 0 ? AVAHI_WATCH_OUT : 0) |