Skip to contentSkip to conversation

synergy: patch CVE-2020-15117

PATCH New [email protected] 1 participant 3 messages Jan 11

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 synergy: patch CVE-2020-15117

From: Peter Marko <[email protected]>

Pick commit based on [1].

Note that the pick is node from deskflow, which is open-source successor of synergy.
If anyone uses thie recipe, it should be switched.

[1] https://github.com/deskflow/deskflow/security/advisories/GHSA-chfm-333q-gfpp

(cherry picked from commit db283053d096cf77df8e4444ce91e5d882f8850c)
---
 .../synergy/synergy/CVE-2020-15117.patch      | 48 +++++++++++++++++++
 .../recipes-support/synergy/synergy_git.bb    |  1 +
 2 files changed, 49 insertions(+)
 create mode 100644 meta-oe/recipes-support/synergy/synergy/CVE-2020-15117.patch
meta-oe/recipes-support/synergy/synergy/CVE-2020-15117.patch new file +48 -0
new file mode 100644
index 0000000000..4ad2a45275
@@ -0,0 +1,48 @@
+From 79efdb7c617b809e1a2daf17441d7a30f7046aa5 Mon Sep 17 00:00:00 2001
+From: Jnewbon <[email protected]>
+Date: Tue, 14 Jul 2020 13:14:40 +0100
+Subject: [PATCH] Merge pull request from GHSA-chfm-333q-gfpp
+
+Attempts to fis DoS to servers with less then 4GB memory
+
+CVE: CVE-2020-15117
+Upstream-Status: Backport [https://github.com/deskflow/deskflow/commit/0a97c2be0da2d0df25cb86dfd642429e7a8bea39]
+Signed-off-by: Peter Marko <[email protected]>
+---
+ src/lib/synergy/ProtocolUtil.cpp | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/src/lib/synergy/ProtocolUtil.cpp b/src/lib/synergy/ProtocolUtil.cpp
+index d9f5dc324..7d2c37ff8 100644
+--- a/src/lib/synergy/ProtocolUtil.cpp
++++ b/src/lib/synergy/ProtocolUtil.cpp
+@@ -61,6 +61,9 @@ ProtocolUtil::readf(synergy::IStream* stream, const char* fmt, ...)
+     catch (XIO&) {
+         result = false;
+     }
++    catch (std::bad_alloc & exception) {
++        result = false;
++    }
+     va_end(args);
+     return result;
+ }
+@@ -216,7 +219,15 @@ ProtocolUtil::vreadf(synergy::IStream* stream, const char* fmt, va_list args)
+                 // allocate a buffer to read the data
+                 UInt8* sBuffer = buffer;
+                 if (!useFixed) {
+-                    sBuffer = new UInt8[len];
++                    try{
++                        sBuffer = new UInt8[len];
++                    }
++                    catch (std::bad_alloc & exception) {
++                        // Added try catch due to GHSA-chfm-333q-gfpp
++                        LOG((CLOG_ERR "ALLOC: Unable to allocate memory %d bytes", len));
++                        LOG((CLOG_DEBUG "bad_alloc detected: Do you have enough free memory?"));
++                        throw exception;
++                    }
+                 }
+ 
+                 // read the data
+-- 
+2.30.2
+
meta-oe/recipes-support/synergy/synergy_git.bb +1 -0
index fb767942fe..2717320886 100644
@@ -10,6 +10,7 @@ DEPENDS = "virtual/libx11 libxtst libxinerama curl openssl"
 REQUIRED_DISTRO_FEATURES = "x11"
 
 SRC_URI = "git://github.com/symless/synergy-core;protocol=https;nobranch=1"
+SRC_URI += "file://CVE-2020-15117.patch"
 
 # Version 1.10.1-stable
 SRCREV ?= "1b4c076127687aceac931d269e898beaac1cad9f"
#1 lore raw

PATCH 2/3 libvpx: upgrade 1.14.0 -> 1.14.1

From: Wang Mingyu <[email protected]>

libvpx-configure-support-blank-prefix.patch
refreshed for 1.14.1

Changelog:
============
- Improved the detection of compiler support for AArch64 extensions, particularly SVE.
- Added vpx_codec_get_global_headers() support for VP9.
- Added buffer bounds checks to vpx_writer and vpx_write_bit_buffer.
- Fix to GetSegmentationData() crash in aq_mode=0 for RTC rate control.
- Fix to alloc for row_base_thresh_freq_fac.
- Free row mt memory before freeing cpi->tile_data.
- Fix to buffer alloc for vp9_bitstream_worker_data.
- Fix to VP8 race issue for multi-thread with pnsr_calc.
- Fix to uv width/height in vp9_scale_and_extend_frame_ssse3.
- Fix to integer division by zero and overflow in calc_pframe_target_size().
- Fix to integer overflow in vpx_img_alloc() & vpx_img_wrap()(CVE-2024-5197).
- Fix to UBSan error in vp9_rc_update_framerate().
- Fix to UBSan errors in vp8_new_framerate().
- Fix to integer overflow in vp8 encodeframe.c.
- Handle EINTR from sem_wait().

(cherry picked from commit 911023b521bebcd7e4ee4bcb2eb97745c2349752)
---
 .../libvpx/libvpx-configure-support-blank-prefix.patch    | 8 ++++----
 .../webm/{libvpx_1.14.0.bb => libvpx_1.14.1.bb}           | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
 rename meta-oe/recipes-multimedia/webm/{libvpx_1.14.0.bb => libvpx_1.14.1.bb} (96%)
meta-oe/recipes-multimedia/webm/libvpx/libvpx-configure-support-blank-prefix.patch +4 -4
index 463651aa4a..bd3d697885 100644
@@ -1,4 +1,4 @@
-From 2829e6998b7595dd2108c1497fdd02485ef99e2c Mon Sep 17 00:00:00 2001
+From 1bbbf27a23c91dcc271b773a97153063461b986d Mon Sep 17 00:00:00 2001
 From: Koen Kooi <[email protected]>
 Date: Tue, 16 Aug 2011 16:04:35 +0200
 Subject: [PATCH] Upstream: not yet
@@ -11,10 +11,10 @@ Upstream-Status: Pending
  1 file changed, 16 insertions(+), 4 deletions(-)
 
 diff --git a/build/make/configure.sh b/build/make/configure.sh
-index b645a666f..0b99a8b38 100644
+index 93643f3de..e84198200 100644
 --- a/build/make/configure.sh
 +++ b/build/make/configure.sh
-@@ -658,6 +658,8 @@ process_common_cmdline() {
+@@ -692,6 +692,8 @@ process_common_cmdline() {
          ;;
        --prefix=*)
          prefix="${optval}"
@@ -23,7 +23,7 @@ index b645a666f..0b99a8b38 100644
          ;;
        --libdir=*)
          libdir="${optval}"
-@@ -687,13 +689,23 @@ process_cmdline() {
+@@ -721,13 +723,23 @@ process_cmdline() {
  }
  
  post_process_common_cmdline() {
meta-oe/recipes-multimedia/webm/libvpx_1.14.1.bb renamed from meta-oe/recipes-multimedia/webm/libvpx_1.14.0.bb +1 -1
similarity index 96%
rename from meta-oe/recipes-multimedia/webm/libvpx_1.14.0.bb
rename to meta-oe/recipes-multimedia/webm/libvpx_1.14.1.bb
index b4d49842ea..f32c7842c3 100644
@@ -7,7 +7,7 @@ LICENSE = "BSD-3-Clause"
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=d5b04755015be901744a78cc30d390d4"
 
-SRCREV = "602e2e8979d111b02c959470da5322797dd96a19"
+SRCREV = "12f3a2ac603e8f10742105519e0cd03c3b8f71dd"
 SRC_URI += "git://chromium.googlesource.com/webm/libvpx;protocol=https;branch=main \
            file://libvpx-configure-support-blank-prefix.patch \
            "
#2 lore raw

PATCH 3/3 id3lib: mark CVE-2007-4460 as fixed

In reply to [email protected]

From: Peter Marko <[email protected]>

This is fixed in id3lib3.8.3_3.8.3-16.2.debian.tar.xz patch included in SRC_URI.
Version 3.8.3-7 contains patch for this CVE, we use 3.8.3-16.2. This can be verified by checking the debian/changelog within this patch or diffing [1] and [2] and verifying that this can be reverse-applied.

[1] https://snapshot.debian.org/archive/debian/20070819T000000Z/pool/main/i/id3lib3.8.3/id3lib3.8.3_3.8.3-6.diff.gz
[2] https://snapshot.debian.org/archive/debian/20070819T000000Z/pool/main/i/id3lib3.8.3/id3lib3.8.3_3.8.3-7.diff.gz

(cherry picked from commit 9fff0040f1694b09c6c68cf59615f42d801d62f5)
---
 meta-oe/recipes-multimedia/id3lib/id3lib_3.8.3.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/recipes-multimedia/id3lib/id3lib_3.8.3.bb +2 -0
index 9e4b516aad..77cd96e91a 100644
@@ -14,6 +14,8 @@ SRC_URI[archive.sha256sum] = "2749cc3c0cd7280b299518b1ddf5a5bcfe2d1100614519b687
 SRC_URI[patch.md5sum] = "3ea90c0aedfcb56a53ac760a94bacb9e"
 SRC_URI[patch.sha256sum] = "6170f085972fdeb5fd69e346860100416707bb0b9f3a73a17a64945dc8b7cfe1"
 
+CVE_STATUS[CVE-2007-4460] = "patched: fix is included in debian patch"
+
 inherit autotools
 
 # Unlike other Debian packages, id3lib*.diff.gz contains another series of