summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Rees <maxcrees@me.com>2020-05-05 11:25:48 -0500
committerMax Rees <maxcrees@me.com>2020-05-05 11:25:48 -0500
commitece7d1f171e81a88656947c48925da94f4d2105f (patch)
treeba1922ec64c18ef4327140f9e54187938a27b5f4
parentf0b42a82699bb782fd074517ca488f1de239e623 (diff)
downloadpackages-ece7d1f171e81a88656947c48925da94f4d2105f.tar.gz
packages-ece7d1f171e81a88656947c48925da94f4d2105f.tar.bz2
packages-ece7d1f171e81a88656947c48925da94f4d2105f.tar.xz
packages-ece7d1f171e81a88656947c48925da94f4d2105f.zip
user/ffmpeg: patch CVE-2019-13312 and CVE-2020-12284 (#156)
-rw-r--r--user/ffmpeg/APKBUILD11
-rw-r--r--user/ffmpeg/CVE-2019-13312.patch30
-rw-r--r--user/ffmpeg/CVE-2020-12284.patch32
3 files changed, 71 insertions, 2 deletions
diff --git a/user/ffmpeg/APKBUILD b/user/ffmpeg/APKBUILD
index b6de0597c..06e68aecb 100644
--- a/user/ffmpeg/APKBUILD
+++ b/user/ffmpeg/APKBUILD
@@ -4,7 +4,7 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=ffmpeg
pkgver=4.2.2
-pkgrel=0
+pkgrel=1
pkgdesc="Record, convert, and stream audio and video"
url="https://ffmpeg.org/"
arch="all"
@@ -21,6 +21,8 @@ makedepends="alsa-lib-dev bzip2-dev freetype-dev gnutls-dev imlib2-dev
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
source="https://ffmpeg.org/releases/ffmpeg-$pkgver.tar.xz
0001-libavutil-clean-up-unused-FF_SYMVER-macro.patch
+ CVE-2019-13312.patch
+ CVE-2020-12284.patch
"
# secfixes:
@@ -37,6 +39,9 @@ source="https://ffmpeg.org/releases/ffmpeg-$pkgver.tar.xz
# - CVE-2017-14222
# - CVE-2017-14223
# - CVE-2017-14225
+# 4.2.2-r1:
+# - CVE-2019-13312
+# - CVE-2020-12284
build() {
_asm=""
@@ -98,4 +103,6 @@ libs() {
}
sha512sums="381cd6732fa699eb89000621cf34256920596ed1f9de3c2194dbad35fdf2165269eb7d3a147a0eb75dc18fbb6d601382b5801750e09fc63547766842f84208e3 ffmpeg-4.2.2.tar.xz
-1047a23eda51b576ac200d5106a1cd318d1d5291643b3a69e025c0a7b6f3dbc9f6eb0e1e6faa231b7e38c8dd4e49a54f7431f87a93664da35825cc2e9e8aedf4 0001-libavutil-clean-up-unused-FF_SYMVER-macro.patch"
+1047a23eda51b576ac200d5106a1cd318d1d5291643b3a69e025c0a7b6f3dbc9f6eb0e1e6faa231b7e38c8dd4e49a54f7431f87a93664da35825cc2e9e8aedf4 0001-libavutil-clean-up-unused-FF_SYMVER-macro.patch
+0c53680ae480b8f848893d4e5c40ea522bd25a72860e0955e039ec838ee09159ab2bfa0eafc71113009082c7f53981ba70116dcef17053cd3cc3ea59e4da5a5c CVE-2019-13312.patch
+910f8da9ed8e0998c311cc451f1725a20c4cc3e9f0c2d1981a1ceea8da5f434519044b4997e71d87424e19fcc45cb203238e49ad178e313696667e6c9bf311c9 CVE-2020-12284.patch"
diff --git a/user/ffmpeg/CVE-2019-13312.patch b/user/ffmpeg/CVE-2019-13312.patch
new file mode 100644
index 000000000..1ef9d92b4
--- /dev/null
+++ b/user/ffmpeg/CVE-2019-13312.patch
@@ -0,0 +1,30 @@
+From ea56af88956061d700043c5c4b026ac57834b0c8 Mon Sep 17 00:00:00 2001
+From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
+Date: Mon, 1 Jul 2019 01:45:36 +0200
+Subject: [PATCH] lavc/zmbvenc: Do not left-shift negative values.
+
+Fixes the following ubsan errors with the sample from ticket #7980:
+libavcodec/zmbvenc.c:243:29: runtime error: left shift of negative value -4
+libavcodec/zmbvenc.c:244:28: runtime error: left shift of negative value -2
+---
+ libavcodec/zmbvenc.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c
+index 4887175..0e22ce6 100644
+--- a/libavcodec/zmbvenc.c
++++ b/libavcodec/zmbvenc.c
+@@ -240,8 +240,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
+ tprev = prev + x * c->bypp;
+
+ zmbv_me(c, tsrc, p->linesize[0], tprev, c->pstride, x, y, &mx, &my, &xored);
+- mv[0] = (mx << 1) | !!xored;
+- mv[1] = my << 1;
++ mv[0] = (mx * 2) | !!xored;
++ mv[1] = my * 2;
+ tprev += mx * c->bypp + my * c->pstride;
+ if(xored){
+ for(j = 0; j < bh2; j++){
+--
+2.7.4
+
diff --git a/user/ffmpeg/CVE-2020-12284.patch b/user/ffmpeg/CVE-2020-12284.patch
new file mode 100644
index 000000000..7360b5870
--- /dev/null
+++ b/user/ffmpeg/CVE-2020-12284.patch
@@ -0,0 +1,32 @@
+From 1812352d767ccf5431aa440123e2e260a4db2726 Mon Sep 17 00:00:00 2001
+From: Michael Niedermayer <michael@niedermayer.cc>
+Date: Sat, 7 Mar 2020 15:42:58 +0100
+Subject: [PATCH] avcodec/cbs_jpeg: Check length for SOS
+
+Fixes: out of array access
+Fixes: 19734/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5673507031875584
+Fixes: 19353/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5703944462663680
+
+Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
+Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
+---
+ libavcodec/cbs_jpeg.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/libavcodec/cbs_jpeg.c b/libavcodec/cbs_jpeg.c
+index 6bbce5f..89512a2 100644
+--- a/libavcodec/cbs_jpeg.c
++++ b/libavcodec/cbs_jpeg.c
+@@ -197,6 +197,9 @@ static int cbs_jpeg_split_fragment(CodedBitstreamContext *ctx,
+ if (marker == JPEG_MARKER_SOS) {
+ length = AV_RB16(frag->data + start);
+
++ if (length > end - start)
++ return AVERROR_INVALIDDATA;
++
+ data_ref = NULL;
+ data = av_malloc(end - start +
+ AV_INPUT_BUFFER_PADDING_SIZE);
+--
+2.7.4
+