Skip to contentSkip to conversation

audiofile: mark CVE-2020-18781 as patched

PATCH New Gyorgy Sarvari 1 participant 5 messages Nov 14, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 audiofile: mark CVE-2020-18781 as patched

From: Peter Marko <[email protected]>

Per [1] this CVE is already patched by commit [2].

This can be also verified with yocto build.

Running without this patch:

root@qemux86-64:~# sfconvert poc.wav output format wave
malloc(): corrupted top size
Aborted

Running with it:

root@qemux86-64:~# sfconvert poc.wav output format wave
Audio File Library: Bad number of coefficients [error 62]
Could not open file 'poc.wav' for reading.

[1] https://github.com/mpruett/audiofile/issues/56
[2] https://github.com/antlarr/audiofile/commit/c48e4c6503f7dabd41f11d4c9c7b7f8960e7f2c0

(cherry picked from commit 68f55c158e15a5d35702ae5c730586001e487f86)
---
 .../files/0004-Always-check-the-number-of-coefficients.patch     | 1 +
 1 file changed, 1 insertion(+)
meta-oe/recipes-multimedia/audiofile/files/0004-Always-check-the-number-of-coefficients.patch +1 -0
index 282f4c01b9..17a97163f5 100644
@@ -17,6 +17,7 @@ CVE: CVE-2017-6832
 CVE: CVE-2017-6833
 CVE: CVE-2017-6835
 CVE: CVE-2017-6837
+CVE: CVE-2020-18781
 Upstream-Status: Inactive-Upstream [lastrelease: 2013]
 Signed-off-by: Peter Marko <[email protected]>
 ---
#1 lore raw

PATCH 2/5 uw-imap: patch CVE-2018-19518

From: Peter Marko <[email protected]>

Take patch from Debian from
https://salsa.debian.org/lts-team/packages/uw-imap/-/commit/873b07f46ce40f43bca10ec85fe63a7a0b934294

(cherry picked from commit 9f7c1e6bd101494c6cc5dad16a7fa65a13cbac70)

Adapted to Kirkstone.

---
 .../uw-imap/uw-imap/CVE-2018-19518.patch      | 24 +++++++++++++++++++
 .../recipes-devtools/uw-imap/uw-imap_2007f.bb |  1 +
 2 files changed, 25 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/uw-imap/uw-imap/CVE-2018-19518.patch
meta-oe/recipes-devtools/uw-imap/uw-imap/CVE-2018-19518.patch new file +24 -0
new file mode 100644
index 0000000000..d942a752b3
@@ -0,0 +1,24 @@
+uw-imap (8:2007f~dfsg-6) unstable; urgency=medium
+
+  * [CVE-2018-19518] 2013_disable_rsh.patch (new): Disable access to IMAP
+    mailboxes through running imapd over rsh, and therefore ssh (Closes:
+    #914632). Code using the library can enable it with tcp_parameters()
+    after making sure that the IMAP server name is sanitized.
+
+ -- Magnus Holmgren <[email protected]>  Tue, 26 Feb 2019 23:35:43 +0100
+
+CVE: CVE-2018-19518
+Upstream-Status: Inactive-Upstream [lastrelease: 2007]
+Signed-off-by: Peter Marko <[email protected]>
+
+--- a/src/osdep/unix/Makefile
++++ b/src/osdep/unix/Makefile
+@@ -988,7 +988,7 @@ onceenv:
+ 	 -DMD5ENABLE=\"$(MD5PWD)\" -DMAILSPOOL=\"$(MAILSPOOL)\" \
+ 	 -DANONYMOUSHOME=\"$(MAILSPOOL)/anonymous\" \
+ 	 -DACTIVEFILE=\"$(ACTIVEFILE)\" -DNEWSSPOOL=\"$(NEWSSPOOL)\" \
+-	 -DRSHPATH=\"$(RSHPATH)\" -DLOCKPGM=\"$(LOCKPGM)\" \
++	 -DLOCKPGM=\"$(LOCKPGM)\" \
+ 	 -DLOCKPGM1=\"$(LOCKPGM1)\" -DLOCKPGM2=\"$(LOCKPGM2)\" \
+ 	 -DLOCKPGM3=\"$(LOCKPGM3)\" > OSCFLAGS
+ 	echo $(BASELDFLAGS) $(EXTRALDFLAGS) > LDFLAGS
meta-oe/recipes-devtools/uw-imap/uw-imap_2007f.bb +1 -0
index df90b629a9..de614716cf 100644
@@ -11,6 +11,7 @@ SRC_URI = "https://fossies.org/linux/misc/old/imap-${PV}.tar.gz \
            file://imap-2007e-shared.patch \
            file://imap-2007f-format-security.patch \
            file://0001-Support-OpenSSL-1.1.patch \
+           file://CVE-2018-19518.patch \
            "
 
 SRC_URI[md5sum] = "2126fd125ea26b73b20f01fcd5940369"
#2 lore raw

PATCH 3/5 usrsctp: patch CVE-2019-20503

In reply to Gyorgy Sarvari

Details: https://nvd.nist.gov/vuln/detail/CVE-2019-20503

Pick the patch mentioned in the nvd report.

---
 .../usrsctp/usrsctp/CVE-2019-20503.patch      | 54 +++++++++++++++++++
 .../recipes-protocols/usrsctp/usrsctp_git.bb  |  3 +-
 2 files changed, 56 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-protocols/usrsctp/usrsctp/CVE-2019-20503.patch
meta-networking/recipes-protocols/usrsctp/usrsctp/CVE-2019-20503.patch new file +54 -0
new file mode 100644
index 0000000000..fc75151f00
@@ -0,0 +1,54 @@
+From c7f318fc788472da19f0a2579d2c2d439e362f04 Mon Sep 17 00:00:00 2001
+From: Michael Tuexen <[email protected]>
+Date: Fri, 20 Dec 2019 17:02:02 +0100
+Subject: [PATCH] Improve input validation for some parameters having a too
+ small reported length.
+
+Thanks to Natalie Silvanovich from Google for finding one of these
+issues in the SCTP userland stack and reporting it.
+
+CVE: CVE-2019-20503
+Upstream-Status: Backport [https://github.com/sctplab/usrsctp/commit/790a7a2555aefb392a5a69923f1e9d17b4968467]
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ usrsctplib/netinet/sctp_auth.c | 3 ++-
+ usrsctplib/netinet/sctp_pcb.c  | 5 ++++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/usrsctplib/netinet/sctp_auth.c b/usrsctplib/netinet/sctp_auth.c
+index 5e5813b..0660af4 100755
+--- a/usrsctplib/netinet/sctp_auth.c
++++ b/usrsctplib/netinet/sctp_auth.c
+@@ -1455,7 +1455,8 @@ sctp_auth_get_cookie_params(struct sctp_tcb *stcb, struct mbuf *m,
+ 		ptype = ntohs(phdr->param_type);
+ 		plen = ntohs(phdr->param_length);
+ 
+-		if ((plen == 0) || (offset + plen > length))
++		if ((plen < sizeof(struct sctp_paramhdr)) ||
++			(offset + plen > length))
+ 			break;
+ 
+ 		if (ptype == SCTP_RANDOM) {
+diff --git a/usrsctplib/netinet/sctp_pcb.c b/usrsctplib/netinet/sctp_pcb.c
+index 6629f24..b99d089 100755
+--- a/usrsctplib/netinet/sctp_pcb.c
++++ b/usrsctplib/netinet/sctp_pcb.c
+@@ -7245,7 +7245,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m,
+ 		if (offset + plen > limit) {
+ 			break;
+ 		}
+-		if (plen == 0) {
++		if (plen < sizeof(struct sctp_paramhdr)) {
+ 			break;
+ 		}
+ #ifdef INET
+@@ -7461,6 +7461,9 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m,
+ 			if (plen > sizeof(lstore)) {
+ 				return (-23);
+ 			}
++			if (plen < sizeof(struct sctp_asconf_addrv4_param)) {
++				return (-101);
++			}
+ 			phdr = sctp_get_next_param(m, offset,
+ 						   (struct sctp_paramhdr *)&lstore,
+ 						   plen);
meta-networking/recipes-protocols/usrsctp/usrsctp_git.bb +2 -1
index dcfa7406d2..2361eacebd 100644
@@ -4,7 +4,8 @@ LIC_FILES_CHKSUM = "file://LICENSE.md;md5=ffcf846341f3856d79a483eafa18e2a5"
 
 SRCREV = "a10cd498d964508c0e6ec6bd2be9dd4afcbb4d86"
 SRC_URI = "git://github.com/sctplab/usrsctp;protocol=https;branch=master \
-          "
+           file://CVE-2019-20503.patch \
+           "
 
 S = "${WORKDIR}/git"
 
#3 lore raw

PATCH 4/5 usbredir: patch CVE-2021-3700

In reply to Gyorgy Sarvari

Details: https://nvd.nist.gov/vuln/detail/CVE-2021-3700

Pick the patch mentioned in the nvd report.

---
 .../spice/usbredir/CVE-2021-3700.patch        | 74 +++++++++++++++++++
 .../recipes-support/spice/usbredir_0.9.0.bb   |  4 +-
 2 files changed, 77 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-support/spice/usbredir/CVE-2021-3700.patch
meta-networking/recipes-support/spice/usbredir/CVE-2021-3700.patch new file +74 -0
new file mode 100644
index 0000000000..4804e740b5
@@ -0,0 +1,74 @@
+From 4851f8d4538e0a25992619ad96a2366c1632e46e Mon Sep 17 00:00:00 2001
+From: Michael Hanselmann <[email protected]>
+Date: Sun, 8 Aug 2021 15:35:58 +0200
+Subject: [PATCH] Avoid use-after-free in serialization
+
+Serializing parsers with large amounts of buffered write data (e.g. in case of
+a slow or blocked write destination) would cause "serialize_data" to reallocate
+the state buffer whose default size is 64kB (USBREDIRPARSER_SERIALIZE_BUF_SIZE).
+The pointer to the position for the write buffer count would then point to
+a location outside the buffer where the number of write buffers would be written
+as a 32-bit value.
+
+As of QEMU 5.2.0 the serializer is invoked for migrations. Serializations for
+migrations may happen regularily such as when using the COLO feature[1].
+Serialization happens under QEMU's I/O lock. The guest can't control the state
+while the serialization is happening. The value written is the number of
+outstanding buffers which would be suceptible to timing and host system system
+load. The guest would have to continously groom the write buffers. A useful
+value needs to be allocated in the exact position freed during the buffer size
+increase, but before the buffer count is written. The author doesn't consider it
+realistic to exploit this use-after-free reliably.
+
+[1] https://wiki.qemu.org/Features/COLO
+
+Signed-off-by: Michael Hanselmann <[email protected]>
+
+CVE: CVE-2021-3700
+Upstream-Status: Backport [https://gitlab.freedesktop.org/spice/usbredir/-/commit/03c519ff5831ba]
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ usbredirparser/usbredirparser.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/usbredirparser/usbredirparser.c b/usbredirparser/usbredirparser.c
+index ba8edb4..ccd3078 100644
+--- a/usbredirparser/usbredirparser.c
++++ b/usbredirparser/usbredirparser.c
+@@ -20,6 +20,7 @@
+ */
+ #include "config.h"
+ 
++#include <stddef.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stdarg.h>
+@@ -1594,8 +1595,9 @@ int usbredirparser_serialize(struct usbredirparser *parser_pub,
+     struct usbredirparser_priv *parser =
+         (struct usbredirparser_priv *)parser_pub;
+     struct usbredirparser_buf *wbuf;
+-    uint8_t *write_buf_count_pos, *state = NULL, *pos = NULL;
++    uint8_t *state = NULL, *pos = NULL;
+     uint32_t write_buf_count = 0, len, remain = 0;
++    ptrdiff_t write_buf_count_pos;
+ 
+     *state_dest = NULL;
+     *state_len = 0;
+@@ -1640,7 +1642,7 @@ int usbredirparser_serialize(struct usbredirparser *parser_pub,
+                        parser->data, parser->data_read, "packet-data"))
+         return -1;
+ 
+-    write_buf_count_pos = pos;
++    write_buf_count_pos = pos - state;
+     /* To be replaced with write_buf_count later */
+     if (serialize_int(parser, &state, &pos, &remain, 0, "write_buf_count"))
+         return -1;
+@@ -1655,7 +1657,7 @@ int usbredirparser_serialize(struct usbredirparser *parser_pub,
+         wbuf = wbuf->next;
+     }
+     /* Patch in write_buf_count */
+-    memcpy(write_buf_count_pos, &write_buf_count, sizeof(int32_t));
++    memcpy(state + write_buf_count_pos, &write_buf_count, sizeof(int32_t));
+ 
+     /* Patch in length */
+     len = pos - state;
meta-networking/recipes-support/spice/usbredir_0.9.0.bb +3 -1
index edd8aeb9c3..bf0d87065e 100644
@@ -9,7 +9,9 @@ DEPENDS = "libusb1"
 
 SRCREV = "bca484fc6f206ab9da2f73e8a0118fad45374d4e"
 
-SRC_URI = "git://gitlab.freedesktop.org/spice/usbredir;branch=main;protocol=https"
+SRC_URI = "git://gitlab.freedesktop.org/spice/usbredir;branch=main;protocol=https \
+           file://CVE-2021-3700.patch \
+           "
 
 S = "${WORKDIR}/git"
 
#4 lore raw

PATCH 5/5 tmux: ignore CVE-2020-27347

In reply to Gyorgy Sarvari

Details: https://nvd.nist.gov/vuln/detail/CVE-2020-27347

The fix for this vulnerability was backported to the recipe's version, and it is included already.

---
 meta-oe/recipes-extended/tmux/tmux_3.1c.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta-oe/recipes-extended/tmux/tmux_3.1c.bb +4 -0
index ec9fe34cf1..f983ed7a86 100644
@@ -23,3 +23,7 @@ do_configure:prepend() {
     # not automatically created when building outside the source directory.
     mkdir -p ${B}/compat
 }
+
+# The fix was backported to the user version:
+# https://github.com/tmux/tmux/commit/d0ad34e94d63def5178f02281637d2d15cb42c88
+CVE_CHECK_IGNORE += "CVE-2020-27347"