ffmpeg: backport patches to fix 12 CVEs
cover ffmpeg: backport patches to fix 12 CVEs
The following changes since commit f7c3a0267aeae74a216de9f081b2cb189388ad88:
qemurunner: print tail qemu log in case bootlog is empty (2017-09-25 14:16:53 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib ChenQi/ffmpeg-cves
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/ffmpeg-cves
Chen Qi (1):
ffmpeg: backport patches to fix 12 CVEs
.../ffmpeg/ffmpeg/CVE-2017-14054.patch | 39 +++++++++ .../ffmpeg/ffmpeg/CVE-2017-14055.patch | 34 ++++++++ .../ffmpeg/ffmpeg/CVE-2017-14056.patch | 51 ++++++++++++ .../ffmpeg/ffmpeg/CVE-2017-14057.patch | 44 ++++++++++ .../ffmpeg/ffmpeg/CVE-2017-14058.patch | 94 ++++++++++++++++++++++ .../ffmpeg/ffmpeg/CVE-2017-14059.patch | 40 +++++++++ .../ffmpeg/ffmpeg/CVE-2017-14169.patch | 39 +++++++++ .../ffmpeg/ffmpeg/CVE-2017-14170.patch | 49 +++++++++++ .../ffmpeg/ffmpeg/CVE-2017-14171.patch | 44 ++++++++++ .../ffmpeg/ffmpeg/CVE-2017-14222.patch | 40 +++++++++ .../ffmpeg/ffmpeg/CVE-2017-14223.patch | 38 +++++++++ .../ffmpeg/ffmpeg/CVE-2017-14225.patch | 49 +++++++++++ meta/recipes-multimedia/ffmpeg/ffmpeg_3.3.3.bb | 12 +++ 13 files changed, 573 insertions(+) create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14054.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14055.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14056.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14057.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14058.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14059.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14169.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14170.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14171.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14222.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14223.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14225.patch
Signature · 1 line
1.9.1
PATCH 1/1 ffmpeg: backport patches to fix 12 CVEs
Backport patches to fix the following CVEs.
CVE-2017-14054
CVE-2017-14055
CVE-2017-14056
CVE-2017-14057
CVE-2017-14058
CVE-2017-14059
CVE-2017-14169
CVE-2017-14170
CVE-2017-14171
CVE-2017-14222
CVE-2017-14223
CVE-2017-14225
--- .../ffmpeg/ffmpeg/CVE-2017-14054.patch | 39 +++++++++ .../ffmpeg/ffmpeg/CVE-2017-14055.patch | 34 ++++++++ .../ffmpeg/ffmpeg/CVE-2017-14056.patch | 51 ++++++++++++ .../ffmpeg/ffmpeg/CVE-2017-14057.patch | 44 ++++++++++ .../ffmpeg/ffmpeg/CVE-2017-14058.patch | 94 ++++++++++++++++++++++ .../ffmpeg/ffmpeg/CVE-2017-14059.patch | 40 +++++++++ .../ffmpeg/ffmpeg/CVE-2017-14169.patch | 39 +++++++++ .../ffmpeg/ffmpeg/CVE-2017-14170.patch | 49 +++++++++++ .../ffmpeg/ffmpeg/CVE-2017-14171.patch | 44 ++++++++++ .../ffmpeg/ffmpeg/CVE-2017-14222.patch | 40 +++++++++ .../ffmpeg/ffmpeg/CVE-2017-14223.patch | 38 +++++++++ .../ffmpeg/ffmpeg/CVE-2017-14225.patch | 49 +++++++++++ meta/recipes-multimedia/ffmpeg/ffmpeg_3.3.3.bb | 12 +++ 13 files changed, 573 insertions(+) create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14054.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14055.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14056.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14057.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14058.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14059.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14169.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14170.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14171.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14222.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14223.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14225.patch
meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14054.patch new file +39 -0
@@ -0,0 +1,39 @@ +From 124eb202e70678539544f6268efc98131f19fa49 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E5=AD=99=E6=B5=A9=20and=20=E5=BC=A0=E6=B4=AA=E4=BA=AE=28?= + =?UTF-8?q?=E6=9C=9B=E5=88=9D=29?= <tony.sh and [email protected]> +Date: Fri, 25 Aug 2017 01:15:28 +0200 +Subject: [PATCH] avformat/rmdec: Fix DoS due to lack of eof check + +Fixes: loop.ivr + +Found-by: Xiaohei and Wangchu from Alibaba Security Team +Signed-off-by: Michael Niedermayer <[email protected]> + +CVE: CVE-2017-14054 +Upstream-Status: Backport + +Signed-off-by: Chen Qi <[email protected]> +--- + libavformat/rmdec.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c +index 178eaea..d6d7d9c 100644 +--- a/libavformat/rmdec.c ++++ b/libavformat/rmdec.c +@@ -1223,8 +1223,11 @@ static int ivr_read_header(AVFormatContext *s) + av_log(s, AV_LOG_DEBUG, "%s = '%s'\n", key, val); + } else if (type == 4) { + av_log(s, AV_LOG_DEBUG, "%s = '0x", key); +- for (j = 0; j < len; j++) ++ for (j = 0; j < len; j++) { ++ if (avio_feof(pb)) ++ return AVERROR_INVALIDDATA; + av_log(s, AV_LOG_DEBUG, "%X", avio_r8(pb)); ++ } + av_log(s, AV_LOG_DEBUG, "'\n"); + } else if (len == 4 && type == 3 && !strncmp(key, "StreamCount", tlen)) { + nb_streams = value = avio_rb32(pb); +-- +2.1.0 +
meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14055.patch new file +34 -0
@@ -0,0 +1,34 @@ +From 4f05e2e2dc1a89f38cd9f0960a6561083d714f1e Mon Sep 17 00:00:00 2001 +From: Michael Niedermayer <[email protected]> +Date: Fri, 25 Aug 2017 01:15:30 +0200 +Subject: [PATCH] avformat/mvdec: Fix DoS due to lack of eof check + +Fixes: loop.mv + +Found-by: Xiaohei and Wangchu from Alibaba Security Team +Signed-off-by: Michael Niedermayer <[email protected]> + +CVE: CVE-2017-14055 +Upstream-Status: Backport + +Signed-off-by: Chen Qi <[email protected]> +--- + libavformat/mvdec.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c +index 0e12c8c..f7aa4cb 100644 +--- a/libavformat/mvdec.c ++++ b/libavformat/mvdec.c +@@ -342,6 +342,8 @@ static int mv_read_header(AVFormatContext *avctx) + uint32_t pos = avio_rb32(pb); + uint32_t asize = avio_rb32(pb); + uint32_t vsize = avio_rb32(pb); ++ if (avio_feof(pb)) ++ return AVERROR_INVALIDDATA; + avio_skip(pb, 8); + av_add_index_entry(ast, pos, timestamp, asize, 0, AVINDEX_KEYFRAME); + av_add_index_entry(vst, pos + asize, i, vsize, 0, AVINDEX_KEYFRAME); +-- +2.1.0 +
meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14056.patch new file +51 -0
51 lines not on this page · raw message
meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14057.patch new file +44 -0
44 lines not on this page · raw message
meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14058.patch new file +94 -0
94 lines not on this page · raw message
meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14059.patch new file +40 -0
@@ -0,0 +1,40 @@ +From 7e80b63ecd259d69d383623e75b318bf2bd491f6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E5=AD=99=E6=B5=A9=20and=20=E5=BC=A0=E6=B4=AA=E4=BA=AE=28?= + =?UTF-8?q?=E6=9C=9B=E5=88=9D=29?= <tony.sh and [email protected]> +Date: Fri, 25 Aug 2017 01:15:27 +0200 +Subject: [PATCH] avformat/cinedec: Fix DoS due to lack of eof check + +Fixes: loop.cine + +Found-by: Xiaohei and Wangchu from Alibaba Security Team +Signed-off-by: Michael Niedermayer <[email protected]> + +CVE: CVE-2017-14059 +Upstream-Status: Backport + +Signed-off-by: Chen Qi <[email protected]> +--- + libavformat/cinedec.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/libavformat/cinedec.c b/libavformat/cinedec.c +index 763b93b..de34fb9 100644 +--- a/libavformat/cinedec.c ++++ b/libavformat/cinedec.c +@@ -267,8 +267,12 @@ static int cine_read_header(AVFormatContext *avctx) + + /* parse image offsets */ + avio_seek(pb, offImageOffsets, SEEK_SET); +- for (i = 0; i < st->duration; i++) ++ for (i = 0; i < st->duration; i++) { ++ if (avio_feof(pb)) ++ return AVERROR_INVALIDDATA; ++ + av_add_index_entry(st, avio_rl64(pb), i, 0, 0, AVINDEX_KEYFRAME); ++ } + + return 0; + } +-- +2.1.0 +
meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14169.patch new file +39 -0
@@ -0,0 +1,39 @@ +From 9d00fb9d70ee8c0cc7002b89318c5be00f1bbdad Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E5=AD=99=E6=B5=A9=28=E6=99=93=E9=BB=91=29?= + <[email protected]> +Date: Tue, 29 Aug 2017 23:59:21 +0200 +Subject: [PATCH] avformat/mxfdec: Fix Sign error in mxf_read_primer_pack() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes: 20170829B.mxf + +Co-Author: 张洪亮(望初)" <[email protected]> +Found-by: Xiaohei and Wangchu from Alibaba Security Team +Signed-off-by: Michael Niedermayer <[email protected]> + +CVE: CVE-2017-14169 +Upstream-Status: Backport + +Signed-off-by: Chen Qi <[email protected]> +--- + libavformat/mxfdec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c +index 6adb77d..91731a7 100644 +--- a/libavformat/mxfdec.c ++++ b/libavformat/mxfdec.c +@@ -500,7 +500,7 @@ static int mxf_read_primer_pack(void *arg, AVIOContext *pb, int tag, int size, U + avpriv_request_sample(pb, "Primer pack item length %d", item_len); + return AVERROR_PATCHWELCOME; + } +- if (item_num > 65536) { ++ if (item_num > 65536 || item_num < 0) { + av_log(mxf->fc, AV_LOG_ERROR, "item_num %d is too large\n", item_num); + return AVERROR_INVALIDDATA; + } +-- +2.1.0 +
meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14170.patch new file +49 -0
49 lines not on this page · raw message
meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14171.patch new file +44 -0
44 lines not on this page · raw message
meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14222.patch new file +40 -0
@@ -0,0 +1,40 @@ +From 9cb4eb772839c5e1de2855d126bf74ff16d13382 Mon Sep 17 00:00:00 2001 +From: Michael Niedermayer <[email protected]> +Date: Tue, 5 Sep 2017 00:16:29 +0200 +Subject: [PATCH] avformat/mov: Fix DoS in read_tfra() + +Fixes: Missing EOF check in loop +No testcase + +Found-by: Xiaohei and Wangchu from Alibaba Security Team +Signed-off-by: Michael Niedermayer <[email protected]> + +CVE: CVE-2017-14222 +Upstream-Status: Backport + +Signed-off-by: Chen Qi <[email protected]> +--- + libavformat/mov.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/libavformat/mov.c b/libavformat/mov.c +index 994e9c6..2519707 100644 +--- a/libavformat/mov.c ++++ b/libavformat/mov.c +@@ -6094,6 +6094,13 @@ static int read_tfra(MOVContext *mov, AVIOContext *f) + } + for (i = 0; i < index->item_count; i++) { + int64_t time, offset; ++ ++ if (avio_feof(f)) { ++ index->item_count = 0; ++ av_freep(&index->items); ++ return AVERROR_INVALIDDATA; ++ } ++ + if (version == 1) { + time = avio_rb64(f); + offset = avio_rb64(f); +-- +2.1.0 +
meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14223.patch new file +38 -0
@@ -0,0 +1,38 @@ +From afc9c683ed9db01edb357bc8c19edad4282b3a97 Mon Sep 17 00:00:00 2001 +From: Michael Niedermayer <[email protected]> +Date: Tue, 5 Sep 2017 00:16:29 +0200 +Subject: [PATCH] avformat/asfdec: Fix DoS in asf_build_simple_index() + +Fixes: Missing EOF check in loop +No testcase + +Found-by: Xiaohei and Wangchu from Alibaba Security Team +Signed-off-by: Michael Niedermayer <[email protected]> + +CVE: CVE-2017-14223 +Upstream-Status: Backport + +Signed-off-by: Chen Qi <[email protected]> +--- + libavformat/asfdec_f.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/libavformat/asfdec_f.c b/libavformat/asfdec_f.c +index f3acbae..cc648b9 100644 +--- a/libavformat/asfdec_f.c ++++ b/libavformat/asfdec_f.c +@@ -1610,6 +1610,11 @@ static int asf_build_simple_index(AVFormatContext *s, int stream_index) + int64_t pos = s->internal->data_offset + s->packet_size * (int64_t)pktnum; + int64_t index_pts = FFMAX(av_rescale(itime, i, 10000) - asf->hdr.preroll, 0); + ++ if (avio_feof(s->pb)) { ++ ret = AVERROR_INVALIDDATA; ++ goto end; ++ } ++ + if (pos != last_pos) { + av_log(s, AV_LOG_DEBUG, "pktnum:%d, pktct:%d pts: %"PRId64"\n", + pktnum, pktct, index_pts); +-- +2.1.0 +
meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2017-14225.patch new file +49 -0
49 lines not on this page · raw message
meta/recipes-multimedia/ffmpeg/ffmpeg_3.3.3.bb +12 -0
@@ -26,6 +26,18 @@ LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \ file://mips64_cpu_detection.patch \ file://0001-build-fix-for-mips.patch \ + file://CVE-2017-14054.patch \ + file://CVE-2017-14055.patch \ + file://CVE-2017-14056.patch \ + file://CVE-2017-14057.patch \ + file://CVE-2017-14058.patch \ + file://CVE-2017-14059.patch \ + file://CVE-2017-14169.patch \ + file://CVE-2017-14170.patch \ + file://CVE-2017-14171.patch \ + file://CVE-2017-14222.patch \ + file://CVE-2017-14223.patch \ + file://CVE-2017-14225.patch \ " SRC_URI[md5sum] = "743dc66ebe67180283b92d029f690d0f" SRC_URI[sha256sum] = "d2a9002cdc6b533b59728827186c044ad02ba64841f1b7cd6c21779875453a1e"
Signature · 1 line
1.9.1
Quoted 14 lines · Chen Qi
Backport patches to fix the following CVEs.
CVE-2017-14054
CVE-2017-14055
CVE-2017-14056
CVE-2017-14057
CVE-2017-14058
CVE-2017-14059
CVE-2017-14169
CVE-2017-14170
CVE-2017-14171
CVE-2017-14222
CVE-2017-14223
CVE-2017-14225
I'd rather just update to 3.3.4. A lot less patch clutter, a lot less chance of an important fix (CVE or not) having been missed, and it's rather unlikely there's something that breaks compared to 3.3.3, as feature development happens in a separate master branch.
Alex
Quoted 16 lines · Alexander Kanavin
Quoted 14 lines · Chen Qi
Backport patches to fix the following CVEs.
CVE-2017-14054
CVE-2017-14055
CVE-2017-14056
CVE-2017-14057
CVE-2017-14058
CVE-2017-14059
CVE-2017-14169
CVE-2017-14170
CVE-2017-14171
CVE-2017-14222
CVE-2017-14223
CVE-2017-14225
Quoted 4 lines
I'd rather just update to 3.3.4. A lot less patch clutter, a lot less chance of an important fix (CVE or not) having been missed, and it's rather unlikely there's something that breaks compared to 3.3.3, as feature development happens in a separate master branch.
Alex
I agree with you. I have tried to do the upgrade, and it's easy.
However, at the current stage, it's unlikely for an upgrade patch to be accepted. That's why I did the backport.
Best Regards,
Chen Qi
Quoted 2 lines · ChenQi
I agree with you. I have tried to do the upgrade, and it's easy.
However, at the current stage, it's unlikely for an upgrade patch to be accepted. That's why I did the backport.
If the upgrade patch brings a new feature release, then yes. But in this case it's clearly:
a) bugfix only (nearly all commits since 3.3.3 start with 'fix' or 'check') and
b) contains security fixes
I think it's only a matter of explaining these two things clearly in the commit message: if you do it, the patch will be accepted.
Alex
Quoted 5 lines · Alexander Kanavin
Quoted 2 lines · ChenQi
I agree with you. I have tried to do the upgrade, and it's easy.
However, at the current stage, it's unlikely for an upgrade patch to be accepted. That's why I did the backport.
Quoted 9 lines
If the upgrade patch brings a new feature release, then yes. But in this case it's clearly:
a) bugfix only (nearly all commits since 3.3.3 start with 'fix' or 'check') and
b) contains security fixesI think it's only a matter of explaining these two things clearly in the commit message: if you do it, the patch will be accepted.
Alex
Alex,
Thanks for your suggestion.
I've sent out an upgrade patch with explanation of why 3.3.4 is a bug fix version.
Boss,
For the upgrade patch and this cve fixing patch, you can pick either of them.
If we cannot merge the patch at this point, it's also OK for me to wait for the next development cycle.
Best Regards,
Chen Qi