aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralpine-mips-patches <info@mobile-stream.com>2018-12-30 09:08:20 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2018-12-31 10:12:49 +0000
commit90497e314c0f7ee1c6804d0819315700efd762b9 (patch)
tree11f396ea55782712242a7f7de129d1e1f41fce1a
parent389d0b359a27f0f187e0666cfd48249bb2a9d2eb (diff)
downloadaports-90497e314c0f7ee1c6804d0819315700efd762b9.tar.bz2
aports-90497e314c0f7ee1c6804d0819315700efd762b9.tar.xz
main/libsndfile: security fixes (CVE-2017-17456, CVE-2017-17457, CVE-2018-19661, CVE-2018-19662)
This is upstream commit 8ddc442d539ca775d80cdbc7af17a718634a743f Partially fixes #9236
-rw-r--r--main/libsndfile/APKBUILD11
-rw-r--r--main/libsndfile/CVE-2017-17456_CVE-2017-17457_CVE-2018-19661_CVE-2018-19662.patch88
2 files changed, 97 insertions, 2 deletions
diff --git a/main/libsndfile/APKBUILD b/main/libsndfile/APKBUILD
index e913e291cf..971c7c508d 100644
--- a/main/libsndfile/APKBUILD
+++ b/main/libsndfile/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libsndfile
pkgver=1.0.28
-pkgrel=3
+pkgrel=4
pkgdesc="A C library for reading and writing files containing sampled sound"
url="http://www.mega-nerd.com/libsndfile"
arch="all"
@@ -16,9 +16,15 @@ source="http://www.mega-nerd.com/$pkgname/files/$pkgname-$pkgver.tar.gz
CVE-2017-8362.patch
CVE-2017-12562.patch
CVE-2018-13139.patch
+ CVE-2017-17456_CVE-2017-17457_CVE-2018-19661_CVE-2018-19662.patch
"
# secfixes:
+# 1.0.28-r4:
+# - CVE-2017-17456
+# - CVE-2017-17457
+# - CVE-2018-19661
+# - CVE-2018-19662
# 1.0.28-r3:
# - CVE-2018-13139
# 1.0.28-r2:
@@ -64,4 +70,5 @@ sha512sums="890731a6b8173f714155ce05eaf6d991b31632c8ab207fbae860968861a107552df2
f98c40696fca3e7bca867df993de55bb4145c23428e65d1a669182eb2293046478ac727ae7f94bb77123ef0355c3c53be4f9d6a432665c90c74687d8d3afd9e3 CVE-2017-8361_CVE-2017-8363_CVE-2017-8365.patch
dfd4b5f1c7471fc416eed5c6040580a020543f145de9103751adaad6ce1c5c6a22abc1cf0ffd381aed3072644cd5ee03ba3598265aa7d202d63167da251cb595 CVE-2017-8362.patch
814139567d90fb07908014e858c341fe933e04dca69b88ad66078910888237bbeba94f85d9e1489883c424f35fca312eb98c21ae2b122d9289bb6418725cd02e CVE-2017-12562.patch
-33817e7c85180635fa239e4ea38973b18312878522639f43071188a995f0e1a35dbca6d133555fb0875292b4b609950ae38e747a6b1949f8ae840db9dc3a2805 CVE-2018-13139.patch"
+33817e7c85180635fa239e4ea38973b18312878522639f43071188a995f0e1a35dbca6d133555fb0875292b4b609950ae38e747a6b1949f8ae840db9dc3a2805 CVE-2018-13139.patch
+ba3e5321713dbc118f45dac6f86049a15e6ba54fc788776eb267b1b165a0853bec278d8b066c71372cd243c852faa6781bef6a71d108e7cdbc64fb77fa3afc0a CVE-2017-17456_CVE-2017-17457_CVE-2018-19661_CVE-2018-19662.patch"
diff --git a/main/libsndfile/CVE-2017-17456_CVE-2017-17457_CVE-2018-19661_CVE-2018-19662.patch b/main/libsndfile/CVE-2017-17456_CVE-2017-17457_CVE-2018-19661_CVE-2018-19662.patch
new file mode 100644
index 0000000000..5b58114dbe
--- /dev/null
+++ b/main/libsndfile/CVE-2017-17456_CVE-2017-17457_CVE-2018-19661_CVE-2018-19662.patch
@@ -0,0 +1,88 @@
+commit 8ddc442d539ca775d80cdbc7af17a718634a743f
+Author: Hugo Lefeuvre <hle@owl.eu.com>
+Date: Mon Dec 24 06:43:48 2018 +0100
+
+ a/ulaw: fix multiple buffer overflows (#432)
+
+ i2ulaw_array() and i2alaw_array() fail to handle ptr [count] = INT_MIN
+ properly, leading to buffer underflow. INT_MIN is a special value
+ since - INT_MIN cannot be represented as int.
+
+ In this case round - INT_MIN to INT_MAX and proceed as usual.
+
+ f2ulaw_array() and f2alaw_array() fail to handle ptr [count] = NaN
+ properly, leading to null pointer dereference.
+
+ In this case, arbitrarily set the buffer value to 0.
+
+ This commit fixes #429 (CVE-2018-19661 and CVE-2018-19662) and
+ fixes #344 (CVE-2017-17456 and CVE-2017-17457).
+
+diff --git a/src/alaw.c b/src/alaw.c
+index 063fd1a2..4220224c 100644
+--- a/src/alaw.c
++++ b/src/alaw.c
+@@ -19,6 +19,7 @@
+ #include "sfconfig.h"
+
+ #include <math.h>
++#include <limits.h>
+
+ #include "sndfile.h"
+ #include "common.h"
+@@ -326,7 +327,9 @@ s2alaw_array (const short *ptr, int count, unsigned char *buffer)
+ static inline void
+ i2alaw_array (const int *ptr, int count, unsigned char *buffer)
+ { while (--count >= 0)
+- { if (ptr [count] >= 0)
++ { if (ptr [count] == INT_MIN)
++ buffer [count] = alaw_encode [INT_MAX >> (16 + 4)] ;
++ else if (ptr [count] >= 0)
+ buffer [count] = alaw_encode [ptr [count] >> (16 + 4)] ;
+ else
+ buffer [count] = 0x7F & alaw_encode [- ptr [count] >> (16 + 4)] ;
+@@ -346,7 +349,9 @@ f2alaw_array (const float *ptr, int count, unsigned char *buffer, float normfact
+ static inline void
+ d2alaw_array (const double *ptr, int count, unsigned char *buffer, double normfact)
+ { while (--count >= 0)
+- { if (ptr [count] >= 0)
++ { if (!isfinite (ptr [count]))
++ buffer [count] = 0 ;
++ else if (ptr [count] >= 0)
+ buffer [count] = alaw_encode [lrint (normfact * ptr [count])] ;
+ else
+ buffer [count] = 0x7F & alaw_encode [- lrint (normfact * ptr [count])] ;
+diff --git a/src/ulaw.c b/src/ulaw.c
+index e50b4cb5..b6070ade 100644
+--- a/src/ulaw.c
++++ b/src/ulaw.c
+@@ -19,6 +19,7 @@
+ #include "sfconfig.h"
+
+ #include <math.h>
++#include <limits.h>
+
+ #include "sndfile.h"
+ #include "common.h"
+@@ -827,7 +828,9 @@ s2ulaw_array (const short *ptr, int count, unsigned char *buffer)
+ static inline void
+ i2ulaw_array (const int *ptr, int count, unsigned char *buffer)
+ { while (--count >= 0)
+- { if (ptr [count] >= 0)
++ { if (ptr [count] == INT_MIN)
++ buffer [count] = ulaw_encode [INT_MAX >> (16 + 2)] ;
++ else if (ptr [count] >= 0)
+ buffer [count] = ulaw_encode [ptr [count] >> (16 + 2)] ;
+ else
+ buffer [count] = 0x7F & ulaw_encode [-ptr [count] >> (16 + 2)] ;
+@@ -847,7 +850,9 @@ f2ulaw_array (const float *ptr, int count, unsigned char *buffer, float normfact
+ static inline void
+ d2ulaw_array (const double *ptr, int count, unsigned char *buffer, double normfact)
+ { while (--count >= 0)
+- { if (ptr [count] >= 0)
++ { if (!isfinite (ptr [count]))
++ buffer [count] = 0 ;
++ else if (ptr [count] >= 0)
+ buffer [count] = ulaw_encode [lrint (normfact * ptr [count])] ;
+ else
+ buffer [count] = 0x7F & ulaw_encode [- lrint (normfact * ptr [count])] ;