All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Anuj Mittal" <anuj.mittal@intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [hardknott][PATCH 12/13] avahi: apply fix for CVE-2021-3468
Date: Tue, 22 Jun 2021 17:50:31 +0800	[thread overview]
Message-ID: <e18f7db2c7159da2d82dc6557edead8bb40ac09f.1624352878.git.anuj.mittal@intel.com> (raw)
In-Reply-To: <cover.1624352878.git.anuj.mittal@intel.com>

From: Ross Burton <ross@burtonini.com>

This patch isn't yet upstream but it has been submitted and other distros
are shipping it.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit ea33a4a2df4600a55b268e9d57e7396c30f3d123)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 meta/recipes-connectivity/avahi/avahi_0.8.bb  |  1 +
 .../avahi/files/handle-hup.patch              | 41 +++++++++++++++++++
 2 files changed, 42 insertions(+)
 create mode 100644 meta/recipes-connectivity/avahi/files/handle-hup.patch

diff --git a/meta/recipes-connectivity/avahi/avahi_0.8.bb b/meta/recipes-connectivity/avahi/avahi_0.8.bb
index 23c0e8d823..a07cdbd03c 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}
            file://99avahi-autoipd \
            file://initscript.patch \
            file://0001-Fix-opening-etc-resolv.conf-error.patch \
+           file://handle-hup.patch \
            "
 
 UPSTREAM_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 @@
+CVE: CVE-2021-3468
+Upstream-Status: Submitted [https://github.com/lathiat/avahi/pull/330]
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+
+From 447affe29991ee99c6b9732fc5f2c1048a611d3b Mon Sep 17 00:00:00 2001
+From: Riccardo Schirone <sirmy15@gmail.com>
+Date: Fri, 26 Mar 2021 11:50:24 +0100
+Subject: [PATCH] Avoid infinite-loop in avahi-daemon by handling HUP event in
+ client_work
+
+If a client fills the input buffer, client_work() disables the
+AVAHI_WATCH_IN event, thus preventing the function from executing the
+`read` syscall the next times it is called. However, if the client then
+terminates the connection, the socket file descriptor receives a HUP
+event, which is not handled, thus the kernel keeps marking the HUP event
+as occurring. While iterating over the file descriptors that triggered
+an event, the client file descriptor will keep having the HUP event and
+the client_work() function is always called with AVAHI_WATCH_HUP but
+without nothing being done, thus entering an infinite loop.
+
+See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=984938
+---
+ avahi-daemon/simple-protocol.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/avahi-daemon/simple-protocol.c b/avahi-daemon/simple-protocol.c
+index 3e0ebb11..6c0274d6 100644
+--- a/avahi-daemon/simple-protocol.c
++++ b/avahi-daemon/simple-protocol.c
+@@ -424,6 +424,11 @@ static void client_work(AvahiWatch *watch, AVAHI_GCC_UNUSED int fd, AvahiWatchEv
+         }
+     }
+ 
++    if (events & AVAHI_WATCH_HUP) {
++        client_free(c);
++        return;
++    }
++
+     c->server->poll_api->watch_update(
+         watch,
+         (c->outbuf_length > 0 ? AVAHI_WATCH_OUT : 0) |
-- 
2.31.1


  parent reply	other threads:[~2021-06-22  9:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22  9:50 [hardknott][PATCH 00/13] review request Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 01/13] curl: cleanup CVE patches for hardknott Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 02/13] libx11: fix CVE-2021-31535 Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 03/13] util-linux.inc: Do not modify BPN Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 04/13] native.bbclass: Do not remove "-native" in the middle of recipe names Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 05/13] linux-yocto/5.4: update to v5.4.124 Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 06/13] lttng-tools: upgrade 2.12.3 -> 2.12.4 Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 07/13] linux-yocto/5.4: update to v5.4.125 Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 08/13] linuxloader: Be aware of riscv32 ldso Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 09/13] valgrind: remove buggy ptest from arm64 Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 10/13] valgrind: Actually install list of non-deterministic ptests Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 11/13] perf: Use python3targetconfig to ensure we use target libraries Anuj Mittal
2021-06-22  9:50 ` Anuj Mittal [this message]
2021-06-22  9:50 ` [hardknott][PATCH 13/13] kernel.bbclass: fix do_sizecheck() comparison Anuj Mittal
2021-06-26 14:29 ` [OE-core] [hardknott][PATCH 00/13] review request Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e18f7db2c7159da2d82dc6557edead8bb40ac09f.1624352878.git.anuj.mittal@intel.com \
    --to=anuj.mittal@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.