summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia
diff options
context:
space:
mode:
authorArmin Kuster <akuster@mvista.com>2021-09-14 17:04:57 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-30 00:02:22 +0100
commit874fe76b00f7a8b31477417611df9929c21c1eaf (patch)
tree382f9504c7e8247b4f3455720e038db0f85fe454 /meta/recipes-multimedia
parenteb3e28fa18a882982c6aaee9ac7a0090e746735d (diff)
downloadpoky-874fe76b00f7a8b31477417611df9929c21c1eaf.tar.gz
libsndfile: Security fix for CVE-2021-3246
Source: https://github.com/libsndfile/libsndfile MR: 112098 Type: Security Fix Disposition: Backport from https://github.com/libsndfile/libsndfile/pull/713 ChangeID: 10d137de063b7a1e543ee96fbcf948945a452869 Description: (From OE-Core rev: f999bac187a935821f8580f3c5b1d08107ba9851) Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-multimedia')
-rw-r--r--meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2021-3246_1.patch36
-rw-r--r--meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2021-3246_2.patch44
-rw-r--r--meta/recipes-multimedia/libsndfile/libsndfile1_1.0.28.bb2
3 files changed, 82 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2021-3246_1.patch b/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2021-3246_1.patch
new file mode 100644
index 0000000000..6354f856cb
--- /dev/null
+++ b/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2021-3246_1.patch
@@ -0,0 +1,36 @@
1From a9815b3f228df00086e0a40bcc43162fc19896a1 Mon Sep 17 00:00:00 2001
2From: bobsayshilol <bobsayshilol@live.co.uk>
3Date: Wed, 17 Feb 2021 23:21:48 +0000
4Subject: [PATCH 1/2] wavlike: Fix incorrect size check
5
6The SF_CART_INFO_16K struct has an additional 4 byte field to hold
7the size of 'tag_text' which the file header doesn't, so don't
8include it as part of the check when looking for the max length.
9
10https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26026
11
12Upstream-Status: Backport
13CVE: CVE-2021-3246 patch 1
14Signed-off-by: Armin Kuster <akuster@mvista.com>
15
16---
17 src/wavlike.c | 6 +++++-
18 1 file changed, 5 insertions(+), 1 deletion(-)
19
20Index: libsndfile-1.0.28/src/wavlike.c
21===================================================================
22--- libsndfile-1.0.28.orig/src/wavlike.c
23+++ libsndfile-1.0.28/src/wavlike.c
24@@ -803,7 +803,11 @@ wavlike_read_cart_chunk (SF_PRIVATE *psf
25 return 0 ;
26 } ;
27
28- if (chunksize >= sizeof (SF_CART_INFO_16K))
29+ /*
30+ ** SF_CART_INFO_16K has an extra field 'tag_text_size' that isn't part
31+ ** of the chunk, so don't include it in the size check.
32+ */
33+ if (chunksize >= sizeof (SF_CART_INFO_16K) - 4)
34 { psf_log_printf (psf, "cart : %u too big to be handled\n", chunksize) ;
35 psf_binheader_readf (psf, "j", chunksize) ;
36 return 0 ;
diff --git a/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2021-3246_2.patch b/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2021-3246_2.patch
new file mode 100644
index 0000000000..d6b03d7d4d
--- /dev/null
+++ b/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2021-3246_2.patch
@@ -0,0 +1,44 @@
1From deb669ee8be55a94565f6f8a6b60890c2e7c6f32 Mon Sep 17 00:00:00 2001
2From: bobsayshilol <bobsayshilol@live.co.uk>
3Date: Thu, 18 Feb 2021 21:52:09 +0000
4Subject: [PATCH 2/2] ms_adpcm: Fix and extend size checks
5
6'blockalign' is the size of a block, and each block contains 7 samples
7per channel as part of the preamble, so check against 'samplesperblock'
8rather than 'blockalign'. Also add an additional check that the block
9is big enough to hold the samples it claims to hold.
10
11https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26803
12
13Upstream-Status: Backport
14CVE: CVE-2021-3246 patch 2
15Signed-off-by: Armin Kuster <akuster@mvista.com>
16
17---
18 src/ms_adpcm.c | 10 ++++++++--
19 1 file changed, 8 insertions(+), 2 deletions(-)
20
21diff --git a/src/ms_adpcm.c b/src/ms_adpcm.c
22index 5e8f1a31..a21cb994 100644
23--- a/src/ms_adpcm.c
24+++ b/src/ms_adpcm.c
25@@ -128,8 +128,14 @@ wavlike_msadpcm_init (SF_PRIVATE *psf, int blockalign, int samplesperblock)
26 if (psf->file.mode == SFM_WRITE)
27 samplesperblock = 2 + 2 * (blockalign - 7 * psf->sf.channels) / psf->sf.channels ;
28
29- if (blockalign < 7 * psf->sf.channels)
30- { psf_log_printf (psf, "*** Error blockalign (%d) should be > %d.\n", blockalign, 7 * psf->sf.channels) ;
31+ /* There's 7 samples per channel in the preamble of each block */
32+ if (samplesperblock < 7 * psf->sf.channels)
33+ { psf_log_printf (psf, "*** Error samplesperblock (%d) should be >= %d.\n", samplesperblock, 7 * psf->sf.channels) ;
34+ return SFE_INTERNAL ;
35+ } ;
36+
37+ if (2 * blockalign < samplesperblock * psf->sf.channels)
38+ { psf_log_printf (psf, "*** Error blockalign (%d) should be >= %d.\n", blockalign, samplesperblock * psf->sf.channels / 2) ;
39 return SFE_INTERNAL ;
40 } ;
41
42--
432.25.1
44
diff --git a/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.28.bb b/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.28.bb
index 044881a859..2525af8fe0 100644
--- a/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.28.bb
+++ b/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.28.bb
@@ -20,6 +20,8 @@ SRC_URI = "http://www.mega-nerd.com/libsndfile/files/libsndfile-${PV}.tar.gz \
20 file://CVE-2017-12562.patch \ 20 file://CVE-2017-12562.patch \
21 file://CVE-2018-19758.patch \ 21 file://CVE-2018-19758.patch \
22 file://CVE-2019-3832.patch \ 22 file://CVE-2019-3832.patch \
23 file://CVE-2021-3246_1.patch \
24 file://CVE-2021-3246_2.patch \
23 " 25 "
24 26
25SRC_URI[md5sum] = "646b5f98ce89ac60cdb060fcd398247c" 27SRC_URI[md5sum] = "646b5f98ce89ac60cdb060fcd398247c"