diff -Nru fastd-18/debian/changelog fastd-18/debian/changelog --- fastd-18/debian/changelog 2019-06-29 11:49:11.000000000 +0000 +++ fastd-18/debian/changelog 2020-10-28 12:06:13.000000000 +0000 @@ -1,3 +1,12 @@ +fastd (18-3ubuntu0.1) focal-security; urgency=medium + + * SECURITY UPDATE: denial of service in receive.c + - debian/patches/CVE-2020-27638.patch: fix buffer leak when receiving + invalid packets. + - CVE-2020-27638 + + -- Emilia Torino Wed, 28 Oct 2020 09:06:13 -0300 + fastd (18-3build1) eoan; urgency=medium * Rebuild against new libjson-c4. diff -Nru fastd-18/debian/control fastd-18/debian/control --- fastd-18/debian/control 2018-01-08 19:48:21.000000000 +0000 +++ fastd-18/debian/control 2020-10-28 12:06:13.000000000 +0000 @@ -1,7 +1,8 @@ Source: fastd Section: net Priority: optional -Maintainer: Matthias Schiffer +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Matthias Schiffer Uploaders: Haiko Helmholz Build-Depends: debhelper (>= 9), cmake (>= 2.8.7), bison (>= 2.5), pkg-config, libcap-dev, libuecc-dev (>= 6), libsodium-dev, libssl-dev, libjson-c-dev, dpkg-dev (>= 1.16.1~) Standards-Version: 4.1.3 diff -Nru fastd-18/debian/patches/CVE-2020-27638.patch fastd-18/debian/patches/CVE-2020-27638.patch --- fastd-18/debian/patches/CVE-2020-27638.patch 1970-01-01 00:00:00.000000000 +0000 +++ fastd-18/debian/patches/CVE-2020-27638.patch 2020-10-28 12:00:16.000000000 +0000 @@ -0,0 +1,43 @@ +From: Matthias Schiffer +Date: Mon, 19 Oct 2020 21:08:16 +0200 +Subject: receive: fix buffer leak when receiving invalid packets + +For fastd versions before v20, this was just a memory leak (which could +still be used for DoS, as it's remotely triggerable). With the new +buffer management of fastd v20, this will trigger an assertion failure +instead as soon as the buffer pool is empty. + +Origin: upstream, https://github.com/NeoRaider/fastd/commit/737925113363b6130879729cdff9ccc46c33eaea +Bug-Debian: https://bugs.debian.org/972521 +--- + src/receive.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/src/receive.c b/src/receive.c +index 732d4a7..a3ecfe3 100644 +--- a/src/receive.c ++++ b/src/receive.c +@@ -186,6 +186,11 @@ static inline void handle_socket_receive_known(fastd_socket_t *sock, const fastd + + case PACKET_HANDSHAKE: + fastd_handshake_handle(sock, local_addr, remote_addr, peer, buffer); ++ break; ++ ++ default: ++ fastd_buffer_free(buffer); ++ pr_debug("received packet with invalid type from %P[%I]", peer, remote_addr); + } + } + +@@ -211,6 +216,11 @@ static inline void handle_socket_receive_unknown(fastd_socket_t *sock, const fas + + case PACKET_HANDSHAKE: + fastd_handshake_handle(sock, local_addr, remote_addr, NULL, buffer); ++ break; ++ ++ default: ++ fastd_buffer_free(buffer); ++ pr_debug("received packet with invalid type from unknown address %I", remote_addr); + } + } + diff -Nru fastd-18/debian/patches/series fastd-18/debian/patches/series --- fastd-18/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ fastd-18/debian/patches/series 2020-10-28 12:00:16.000000000 +0000 @@ -0,0 +1 @@ +CVE-2020-27638.patch