diff options
author | Kiran Surendran <kiran.surendran@windriver.com> | 2021-10-18 10:20:18 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-23 17:42:26 +0100 |
commit | 1c1dd2097fb26219e7c4303870e182dc16a6b358 (patch) | |
tree | d2d1b3ba154eb1c8ce75ff5273b20892abe066bd | |
parent | e736b200a0129747d35f1f8e4b406b9215937baf (diff) | |
download | poky-1c1dd2097fb26219e7c4303870e182dc16a6b358.tar.gz |
ffmpeg: fix CVE-2021-38114
backport from upstream
(From OE-Core rev: fe9cdf74f7ef3637ed7c600182f8a0ba40510d2a)
Signed-off-by: Kiran Surendran <kiran.surendran@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2021-38114.patch | 67 | ||||
-rw-r--r-- | meta/recipes-multimedia/ffmpeg/ffmpeg_4.4.bb | 3 |
2 files changed, 69 insertions, 1 deletions
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2021-38114.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2021-38114.patch new file mode 100644 index 0000000000..ab3ecfecbb --- /dev/null +++ b/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2021-38114.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | CVE: CVE-2021-38114 | ||
2 | Upstream-Status: Backport | ||
3 | Signed-off-by: Kiran Surendran <kiran.surendran@windriver.com> | ||
4 | |||
5 | From 463dbe4e78cc560ca5b09f23a07add0eb78ccee8 Mon Sep 17 00:00:00 2001 | ||
6 | From: maryam ebr <me22bee@outlook.com> | ||
7 | Date: Tue, 3 Aug 2021 01:05:47 -0400 | ||
8 | Subject: [PATCH] avcodec/dnxhddec: check and propagate function return value | ||
9 | |||
10 | Similar to CVE-2013-0868, here return value check for 'init_vlc' is needed. | ||
11 | crafted DNxHD data can cause unspecified impact. | ||
12 | |||
13 | Reviewed-by: Paul B Mahol <onemda@gmail.com> | ||
14 | Signed-off-by: James Almer <jamrial@gmail.com> | ||
15 | --- | ||
16 | libavcodec/dnxhddec.c | 22 +++++++++++++++------- | ||
17 | 1 file changed, 15 insertions(+), 7 deletions(-) | ||
18 | |||
19 | diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c | ||
20 | index c78d55aee5..9b475a6979 100644 | ||
21 | --- a/libavcodec/dnxhddec.c | ||
22 | +++ b/libavcodec/dnxhddec.c | ||
23 | @@ -112,6 +112,7 @@ static av_cold int dnxhd_decode_init(AVCodecContext *avctx) | ||
24 | |||
25 | static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid, int bitdepth) | ||
26 | { | ||
27 | + int ret; | ||
28 | if (cid != ctx->cid) { | ||
29 | const CIDEntry *cid_table = ff_dnxhd_get_cid_table(cid); | ||
30 | |||
31 | @@ -132,19 +133,26 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid, int bitdepth) | ||
32 | ff_free_vlc(&ctx->dc_vlc); | ||
33 | ff_free_vlc(&ctx->run_vlc); | ||
34 | |||
35 | - init_vlc(&ctx->ac_vlc, DNXHD_VLC_BITS, 257, | ||
36 | + if ((ret = init_vlc(&ctx->ac_vlc, DNXHD_VLC_BITS, 257, | ||
37 | ctx->cid_table->ac_bits, 1, 1, | ||
38 | - ctx->cid_table->ac_codes, 2, 2, 0); | ||
39 | - init_vlc(&ctx->dc_vlc, DNXHD_DC_VLC_BITS, bitdepth > 8 ? 14 : 12, | ||
40 | + ctx->cid_table->ac_codes, 2, 2, 0)) < 0) | ||
41 | + goto out; | ||
42 | + if ((ret = init_vlc(&ctx->dc_vlc, DNXHD_DC_VLC_BITS, bitdepth > 8 ? 14 : 12, | ||
43 | ctx->cid_table->dc_bits, 1, 1, | ||
44 | - ctx->cid_table->dc_codes, 1, 1, 0); | ||
45 | - init_vlc(&ctx->run_vlc, DNXHD_VLC_BITS, 62, | ||
46 | + ctx->cid_table->dc_codes, 1, 1, 0)) < 0) | ||
47 | + goto out; | ||
48 | + if ((ret = init_vlc(&ctx->run_vlc, DNXHD_VLC_BITS, 62, | ||
49 | ctx->cid_table->run_bits, 1, 1, | ||
50 | - ctx->cid_table->run_codes, 2, 2, 0); | ||
51 | + ctx->cid_table->run_codes, 2, 2, 0)) < 0) | ||
52 | + goto out; | ||
53 | |||
54 | ctx->cid = cid; | ||
55 | } | ||
56 | - return 0; | ||
57 | + ret = 0; | ||
58 | +out: | ||
59 | + if (ret < 0) | ||
60 | + av_log(ctx->avctx, AV_LOG_ERROR, "init_vlc failed\n"); | ||
61 | + return ret; | ||
62 | } | ||
63 | |||
64 | static int dnxhd_get_profile(int cid) | ||
65 | -- | ||
66 | 2.31.1 | ||
67 | |||
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg_4.4.bb b/meta/recipes-multimedia/ffmpeg/ffmpeg_4.4.bb index 0c6af6549d..c0318ef01d 100644 --- a/meta/recipes-multimedia/ffmpeg/ffmpeg_4.4.bb +++ b/meta/recipes-multimedia/ffmpeg/ffmpeg_4.4.bb | |||
@@ -31,7 +31,8 @@ SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \ | |||
31 | file://fix-CVE-2020-22021.patch \ | 31 | file://fix-CVE-2020-22021.patch \ |
32 | file://fix-CVE-2020-22033-CVE-2020-22019.patch \ | 32 | file://fix-CVE-2020-22033-CVE-2020-22019.patch \ |
33 | file://fix-CVE-2021-33815.patch \ | 33 | file://fix-CVE-2021-33815.patch \ |
34 | file://fix-CVE-2021-38171.patch \ | 34 | file://fix-CVE-2021-38171.patch \ |
35 | file://fix-CVE-2021-38114.patch \ | ||
35 | " | 36 | " |
36 | SRC_URI[sha256sum] = "06b10a183ce5371f915c6bb15b7b1fffbe046e8275099c96affc29e17645d909" | 37 | SRC_URI[sha256sum] = "06b10a183ce5371f915c6bb15b7b1fffbe046e8275099c96affc29e17645d909" |
37 | 38 | ||