sox: patch CVE-2017-18189

Details: https://nvd.nist.gov/vuln/detail/CVE-2017-18189

Pick the patch that was identified by Debian[1] as the solution.

[1]: https://security-tracker.debian.org/tracker/CVE-2017-18189

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
This commit is contained in:
Gyorgy Sarvari 2026-01-26 14:05:02 +01:00 committed by Anuj Mittal
parent 083add805e
commit f81e7c9574
No known key found for this signature in database
GPG Key ID: 4340AEFE69F5085C
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,34 @@
From c9e266bc77952c873a28ae320dac2eae5cbc9934 Mon Sep 17 00:00:00 2001
From: Mans Rullgard <mans@mansr.com>
Date: Thu, 9 Nov 2017 11:45:10 +0000
Subject: [PATCH] xa: validate channel count
A corrupt header specifying zero channels would send read_channels()
into an infinite loop. Prevent this by sanity checking the channel
count in open_read(). Also add an upper bound to prevent overflow
in multiplication.
CVE: CVE-2017-18189
Upstream-Status: Backport [https://github.com/mansr/sox/commit/7a8ceb86212b28243bbb6d0de636f0dfbe833e53]
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
src/xa.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/xa.c b/src/xa.c
index 81a7677..9fc086e 100644
--- a/src/xa.c
+++ b/src/xa.c
@@ -143,6 +143,12 @@ static int startread(sox_format_t * ft)
lsx_report("User options overriding rate read in .xa header");
}
+ if (ft->signal.channels == 0 || ft->signal.channels > UINT16_MAX) {
+ lsx_fail_errno(ft, SOX_EFMT, "invalid channel count %d",
+ ft->signal.channels);
+ return SOX_EOF;
+ }
+
/* Check for supported formats */
if (ft->encoding.bits_per_sample != 16) {
lsx_fail_errno(ft, SOX_EFMT, "%d-bit sample resolution not supported.",

View File

@ -37,6 +37,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/sox/sox-${PV}.tar.gz \
file://CVE-2017-15371.patch \
file://CVE-2017-15372.patch \
file://CVE-2017-15642.patch \
file://CVE-2017-18189.patch \
"
SRC_URI[md5sum] = "d04fba2d9245e661f245de0577f48a33"
SRC_URI[sha256sum] = "b45f598643ffbd8e363ff24d61166ccec4836fea6d3888881b8df53e3bb55f6c"