[vorbis-tools] 01/01: oggenc: Validate count of channels in the header (CVE-2014-9638, CVE-2014-9639).
Petter Reinholdtsen
pere at moszumanska.debian.org
Tue Sep 22 13:16:37 UTC 2015
This is an automated email from the git hooks/post-receive script.
pere pushed a commit to branch master
in repository vorbis-tools.
commit 694517ae153dac402db3fefc336de1f83b2677b3
Author: Petter Reinholdtsen <pere at hungry.com>
Date: Tue Sep 22 15:14:06 2015 +0200
oggenc: Validate count of channels in the header (CVE-2014-9638, CVE-2014-9639).
Patch from Kamil Dudka.
Closes: 776086
---
...16-Validate-channel-count-in-audio-header.patch | 82 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 83 insertions(+)
diff --git a/debian/patches/0016-Validate-channel-count-in-audio-header.patch b/debian/patches/0016-Validate-channel-count-in-audio-header.patch
new file mode 100644
index 0000000..4a40846
--- /dev/null
+++ b/debian/patches/0016-Validate-channel-count-in-audio-header.patch
@@ -0,0 +1,82 @@
+Description: oggenc: validate count of channels in the header
+ Fixes CVE-2014-9638 and CVE-2014-9639.
+Author: Kamil Dudka kdudka at redhat.com
+Bug-Debian: https://bugs.debian.org/
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: http://lists.xiph.org/pipermail/vorbis-dev/2015-February/020423.html
+Bug: https://trac.xiph.org/ticket/2136
+Bug: https://trac.xiph.org/ticket/2137
+Bug-Debian: https://bugs.debian.org/776086
+Forwarded: not-needed
+Reviewed-By: Petter Reinholdtsen <pere at hungry.com>
+Last-Update: 2015-09-22
+
+--- vorbis-tools-1.4.0.orig/oggenc/audio.c
++++ vorbis-tools-1.4.0/oggenc/audio.c
+@@ -13,6 +13,7 @@
+ #include <config.h>
+ #endif
+
++#include <limits.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+@@ -251,6 +252,7 @@ int aiff_open(FILE *in, oe_enc_opt *opt,
+ aiff_fmt format;
+ aifffile *aiff = malloc(sizeof(aifffile));
+ int i;
++ long channels;
+
+ if(buf[11]=='C')
+ aifc=1;
+@@ -277,11 +279,16 @@ int aiff_open(FILE *in, oe_enc_opt *opt,
+ return 0;
+ }
+
+- format.channels = READ_U16_BE(buffer);
++ format.channels = channels = READ_U16_BE(buffer);
+ format.totalframes = READ_U32_BE(buffer+2);
+ format.samplesize = READ_U16_BE(buffer+6);
+ format.rate = (int)read_IEEE80(buffer+8);
+
++ if(channels <= 0L || SHRT_MAX < channels)
++ {
++ fprintf(stderr, _("Warning: Unsupported count of channels in AIFF header\n"));
++ return 0;
++ }
+ aiff->bigendian = 1;
+
+ if(aifc)
+@@ -412,6 +419,7 @@ int wav_open(FILE *in, oe_enc_opt *opt,
+ wav_fmt format;
+ wavfile *wav = malloc(sizeof(wavfile));
+ int i;
++ long channels;
+
+ /* Ok. At this point, we know we have a WAV file. Now we have to detect
+ * whether we support the subtype, and we have to find the actual data
+@@ -449,12 +457,18 @@ int wav_open(FILE *in, oe_enc_opt *opt,
+ }
+
+ format.format = READ_U16_LE(buf);
+- format.channels = READ_U16_LE(buf+2);
++ format.channels = channels = READ_U16_LE(buf+2);
+ format.samplerate = READ_U32_LE(buf+4);
+ format.bytespersec = READ_U32_LE(buf+8);
+ format.align = READ_U16_LE(buf+12);
+ format.samplesize = READ_U16_LE(buf+14);
+
++ if(channels <= 0L || SHRT_MAX < channels)
++ {
++ fprintf(stderr, _("Warning: Unsupported count of channels in WAV header\n"));
++ return 0;
++ }
++
+ if(format.format == -2) /* WAVE_FORMAT_EXTENSIBLE */
+ {
+ if(len<40)
diff --git a/debian/patches/series b/debian/patches/series
index 3be8c5f..bde560b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -13,3 +13,4 @@
0013-Fix-oggdec-crash-hang-Don-t-ignore-stream-errors.patch
0014-Use-translations-in-oggdec.patch
0015-Fix-Large-alloca-on-bad-AIFF-input-CVE-2015-6749.patch
+0016-Validate-channel-count-in-audio-header.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-xiph/vorbis-tools.git
More information about the pkg-xiph-commits
mailing list