summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorJackie Huang <jackie.huang@windriver.com>2017-08-17 14:44:28 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-18 23:46:38 +0100
commit0bead4042320351d39f81b8cf7281e91c777aa7d (patch)
tree41d2d9d06fd6ad94c17480171d7c622cde4f0d36 /meta
parent768cd2beff0949bbe1bd07f2dc0d46ba105ca875 (diff)
downloadpoky-0bead4042320351d39f81b8cf7281e91c777aa7d.tar.gz
libsndfile1: Fix CVE-2017-8362
Backport the patch to fix CVE-2017-8362: The flac_buffer_copy function in flac.c in libsndfile 1.0.28 allows remote attackers to cause a denial of service (invalid read and application crash) via a crafted audio file. Reference: https://nvd.nist.gov/vuln/detail/CVE-2017-8362 (From OE-Core rev: 0c8da3f6f85962196f2ad54fffd839239f5c2274) Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8362.patch59
-rw-r--r--meta/recipes-multimedia/libsndfile/libsndfile1_1.0.28.bb1
2 files changed, 60 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8362.patch b/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8362.patch
new file mode 100644
index 0000000000..9ee7e46a6d
--- /dev/null
+++ b/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8362.patch
@@ -0,0 +1,59 @@
1From ef1dbb2df1c0e741486646de40bd638a9c4cd808 Mon Sep 17 00:00:00 2001
2From: Erik de Castro Lopo <erikd@mega-nerd.com>
3Date: Fri, 14 Apr 2017 15:19:16 +1000
4Subject: [PATCH] src/flac.c: Fix a buffer read overflow
5
6A file (generated by a fuzzer) which increased the number of channels
7from one frame to the next could cause a read beyond the end of the
8buffer provided by libFLAC. Only option is to abort the read.
9
10Closes: https://github.com/erikd/libsndfile/issues/231
11
12CVE: CVE-2017-8362
13
14Upstream-Status: Backport [https://github.com/erikd/libsndfile/commit/ef1dbb2df1c0e741486646de40bd638a9c4cd808]
15
16Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
17---
18 src/flac.c | 11 +++++++++--
19 1 file changed, 9 insertions(+), 2 deletions(-)
20
21diff --git a/src/flac.c b/src/flac.c
22index 5a4f8c2..e4f9aaa 100644
23--- a/src/flac.c
24+++ b/src/flac.c
25@@ -169,6 +169,14 @@ flac_buffer_copy (SF_PRIVATE *psf)
26 const int32_t* const *buffer = pflac->wbuffer ;
27 unsigned i = 0, j, offset, channels, len ;
28
29+ if (psf->sf.channels != (int) frame->header.channels)
30+ { psf_log_printf (psf, "Error: FLAC frame changed from %d to %d channels\n"
31+ "Nothing to do but to error out.\n" ,
32+ psf->sf.channels, frame->header.channels) ;
33+ psf->error = SFE_FLAC_CHANNEL_COUNT_CHANGED ;
34+ return 0 ;
35+ } ;
36+
37 /*
38 ** frame->header.blocksize is variable and we're using a constant blocksize
39 ** of FLAC__MAX_BLOCK_SIZE.
40@@ -202,7 +210,6 @@ flac_buffer_copy (SF_PRIVATE *psf)
41 return 0 ;
42 } ;
43
44-
45 len = SF_MIN (pflac->len, frame->header.blocksize) ;
46
47 if (pflac->remain % channels != 0)
48@@ -436,7 +443,7 @@ sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC_
49 { case FLAC__METADATA_TYPE_STREAMINFO :
50 if (psf->sf.channels > 0 && psf->sf.channels != (int) metadata->data.stream_info.channels)
51 { psf_log_printf (psf, "Error: FLAC stream changed from %d to %d channels\n"
52- "Nothing to be but to error out.\n" ,
53+ "Nothing to do but to error out.\n" ,
54 psf->sf.channels, metadata->data.stream_info.channels) ;
55 psf->error = SFE_FLAC_CHANNEL_COUNT_CHANGED ;
56 return ;
57--
582.7.4
59
diff --git a/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.28.bb b/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.28.bb
index f80ce2fc99..2bd51b1cd9 100644
--- a/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.28.bb
+++ b/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.28.bb
@@ -8,6 +8,7 @@ LICENSE = "LGPLv2.1"
8SRC_URI = "http://www.mega-nerd.com/libsndfile/files/libsndfile-${PV}.tar.gz \ 8SRC_URI = "http://www.mega-nerd.com/libsndfile/files/libsndfile-${PV}.tar.gz \
9 file://CVE-2017-6892.patch \ 9 file://CVE-2017-6892.patch \
10 file://CVE-2017-8361-8365.patch \ 10 file://CVE-2017-8361-8365.patch \
11 file://CVE-2017-8362.patch \
11 " 12 "
12 13
13SRC_URI[md5sum] = "646b5f98ce89ac60cdb060fcd398247c" 14SRC_URI[md5sum] = "646b5f98ce89ac60cdb060fcd398247c"