kumquat-buildroot/package/freeswitch/0002-core-fix--disable-libyuv.patch

130 lines
3.9 KiB
Diff
Raw Normal View History

package/freeswitch: security bump version to 1.10.7 Fixes the following security issues: - CVE-2021-41105: FreeSWITCH susceptible to Denial of Service via invalid SRTP packets When handling SRTP calls, FreeSWITCH is susceptible to a DoS where calls can be terminated by remote attackers. This attack can be done continuously, thus denying encrypted calls during the attack. https://github.com/signalwire/freeswitch/security/advisories/GHSA-jh42-prph-gp36 - CVE-2021-41157: FreeSWITCH does not authenticate SIP SUBSCRIBE requests by default By default, SIP requests of the type SUBSCRIBE are not authenticated in the affected versions of FreeSWITCH. https://github.com/signalwire/freeswitch/security/advisories/GHSA-g7xg-7c54-rmpj - CVE-2021-37624: FreeSWITCH does not authenticate SIP MESSAGE requests, leading to spam and message spoofing By default, SIP requests of the type MESSAGE (RFC 3428) are not authenticated in the affected versions of FreeSWITCH. MESSAGE requests are relayed to SIP user agents registered with the FreeSWITCH server without requiring any authentication. Although this behaviour can be changed by setting the auth-messages parameter to true, it is not the default setting. https://github.com/signalwire/freeswitch/security/advisories/GHSA-mjcm-q9h8-9xv3 - CVE-2021-41145: FreeSWITCH susceptible to Denial of Service via SIP flooding When flooding FreeSWITCH with SIP messages, it was observed that after a number of seconds the process was killed by the operating system due to memory exhaustion https://github.com/signalwire/freeswitch/security/advisories/GHSA-jvpq-23v4-gp3m - CVE-2021-41158: FreeSWITCH vulnerable to SIP digest leak for configured gateways An attacker can perform a SIP digest leak attack against FreeSWITCH and receive the challenge response of a gateway configured on the FreeSWITCH server. This is done by challenging FreeSWITCH's SIP requests with the realm set to that of the gateway, thus forcing FreeSWITCH to respond with the challenge response which is based on the password of that targeted gateway. https://github.com/signalwire/freeswitch/security/advisories/GHSA-3v3f-99mv-qvj4 Release notes: https://github.com/signalwire/freeswitch/releases/tag/v1.10.7 Removed patch, upstream applied a different fix: https://github.com/signalwire/freeswitch/commit/e9fde845de5b8885282bf5e70f4be3645c5c3e9b Added optional dependency to libks, needed due to upstream commit https://github.com/signalwire/freeswitch/commit/ed9851666615d283effb76edc7028cc08b07eff9 Added upstream patches to fix build errors. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de> [Peter: mention security fixes] Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2021-11-06 12:11:45 +01:00
From a2ce46c6fde38d6ac54a8a2ee1a5b391e2ed2071 Mon Sep 17 00:00:00 2001
From: Sebastian Kemper <sebastian_ml@gmx.net>
Date: Mon, 1 Nov 2021 09:59:09 +0100
Subject: [PATCH] [core] fix "--disable-libyuv"
Recent changes made it impossible to compile freeswitch without libyuv
support.
src/switch_core_video.c: In function 'switch_img_read_from_file':
src/switch_core_video.c:3139:4: error: implicit declaration of function 'RAWToI420' [-Werror=implicit-function-declaration]
RAWToI420(data, width * 3,
^
src/switch_core_video.c:3148:4: error: implicit declaration of function 'ABGRToARGB' [-Werror=implicit-function-declaration]
ABGRToARGB(data, width * 4, img->planes[SWITCH_PLANE_PACKED], img->stride[SWITCH_PLANE_PACKED], width, height);
^
Fix this my adding/moving the checks for "SWITCH_HAVE_YUV".
Downloaded from upstream commit:
https://github.com/signalwire/freeswitch/commit/a2ce46c6fde38d6ac54a8a2ee1a5b391e2ed2071
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
---
src/switch_core_video.c | 12 ++++++++++++
tests/unit/switch_core_video.c | 4 ++++
2 files changed, 16 insertions(+)
diff --git a/src/switch_core_video.c b/src/switch_core_video.c
index 7dbd685d6ee..0d377f9c3e4 100644
--- a/src/switch_core_video.c
+++ b/src/switch_core_video.c
@@ -3116,6 +3116,7 @@ SWITCH_DECLARE(switch_status_t) switch_img_data_url_png(switch_image_t *img, cha
SWITCH_DECLARE(switch_image_t *) switch_img_read_from_file(const char* file_name, switch_img_fmt_t img_fmt)
{
+#ifdef SWITCH_HAVE_YUV
int width = 0, height = 0, channels = 0;
int comp = STBI_rgb;
unsigned char *data = NULL;
@@ -3155,12 +3156,16 @@ SWITCH_DECLARE(switch_image_t *) switch_img_read_from_file(const char* file_name
} else if (data) {
stbi_image_free(data);
}
+#endif
return NULL;
}
SWITCH_DECLARE(switch_status_t) switch_img_write_to_file(switch_image_t *img, const char* file_name, int quality)
{
+#ifndef SWITCH_HAVE_YUV
+ return SWITCH_STATUS_FALSE;
+#else
int comp = STBI_rgb;
unsigned char *data = NULL;
const char *ext = strrchr(file_name, '.');
@@ -3217,6 +3222,7 @@ SWITCH_DECLARE(switch_status_t) switch_img_write_to_file(switch_image_t *img, co
free(data);
return ret ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
+#endif
}
typedef struct data_url_context_s {
@@ -3224,14 +3230,19 @@ typedef struct data_url_context_s {
char **urlP;
} data_url_context_t;
+#ifdef SWITCH_HAVE_YUV
static void data_url_write_func(void *context, void *data, int size)
{
switch_buffer_t *buffer = (switch_buffer_t *)context;
switch_buffer_write(buffer, data, size);
}
+#endif
SWITCH_DECLARE(switch_status_t) switch_img_data_url(switch_image_t *img, char **urlP, const char *type, int quality)
{
+#ifndef SWITCH_HAVE_YUV
+ return SWITCH_STATUS_FALSE;
+#else
int comp = STBI_rgb;
unsigned char *data = NULL;
int stride_in_bytes = 0;
@@ -3300,6 +3311,7 @@ SWITCH_DECLARE(switch_status_t) switch_img_data_url(switch_image_t *img, char **
switch_buffer_destroy(&buffer);
return ret ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
+#endif /* SWITCH_HAVE_YUV */
}
diff --git a/tests/unit/switch_core_video.c b/tests/unit/switch_core_video.c
index 27c96102929..e395db474d5 100644
--- a/tests/unit/switch_core_video.c
+++ b/tests/unit/switch_core_video.c
@@ -48,6 +48,7 @@ FST_CORE_BEGIN("./conf")
}
FST_TEARDOWN_END()
+#ifdef SWITCH_HAVE_YUV
FST_TEST_BEGIN(data_url_test)
{
char *data_url = NULL;
@@ -88,6 +89,7 @@ FST_CORE_BEGIN("./conf")
unlink(argb_filename);
}
FST_TEST_END()
+#endif /* SWITCH_HAVE_YUV */
FST_TEST_BEGIN(img_patch)
{
@@ -239,6 +241,7 @@ FST_CORE_BEGIN("./conf")
}
FST_TEST_END()
+#ifdef SWITCH_HAVE_YUV
FST_TEST_BEGIN(stb_data_url)
{
switch_image_t *img = switch_img_alloc(NULL, SWITCH_IMG_FMT_I420, 120, 60, 1);
@@ -321,6 +324,7 @@ FST_CORE_BEGIN("./conf")
unlink(jpg_write_filename);
}
FST_TEST_END()
+#endif /* SWITCH_HAVE_YUV */
}
FST_SUITE_END()
}