summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-multimedia')
-rw-r--r--meta/recipes-multimedia/libtiff/files/0001-tiffset-fix-global-buffer-overflow-for-ASCII-tags-wh.patch43
-rw-r--r--meta/recipes-multimedia/libtiff/tiff_4.3.0.bb3
2 files changed, 45 insertions, 1 deletions
diff --git a/meta/recipes-multimedia/libtiff/files/0001-tiffset-fix-global-buffer-overflow-for-ASCII-tags-wh.patch b/meta/recipes-multimedia/libtiff/files/0001-tiffset-fix-global-buffer-overflow-for-ASCII-tags-wh.patch
new file mode 100644
index 0000000000..72776f09ba
--- /dev/null
+++ b/meta/recipes-multimedia/libtiff/files/0001-tiffset-fix-global-buffer-overflow-for-ASCII-tags-wh.patch
@@ -0,0 +1,43 @@
1CVE: CVE-2022-22844
2Upstream-Status: Backport
3Signed-off-by: Ross Burton <ross.burton@arm.com>
4
5From b12a0326e6064b6e0b051d1184a219877472f69b Mon Sep 17 00:00:00 2001
6From: 4ugustus <wangdw.augustus@qq.com>
7Date: Tue, 25 Jan 2022 16:25:28 +0000
8Subject: [PATCH] tiffset: fix global-buffer-overflow for ASCII tags where
9 count is required (fixes #355)
10
11---
12 tools/tiffset.c | 16 +++++++++++++---
13 1 file changed, 13 insertions(+), 3 deletions(-)
14
15diff --git a/tools/tiffset.c b/tools/tiffset.c
16index 8c9e23c5..e7a88c09 100644
17--- a/tools/tiffset.c
18+++ b/tools/tiffset.c
19@@ -146,9 +146,19 @@ main(int argc, char* argv[])
20
21 arg_index++;
22 if (TIFFFieldDataType(fip) == TIFF_ASCII) {
23- if (TIFFSetField(tiff, TIFFFieldTag(fip), argv[arg_index]) != 1)
24- fprintf( stderr, "Failed to set %s=%s\n",
25- TIFFFieldName(fip), argv[arg_index] );
26+ if(TIFFFieldPassCount( fip )) {
27+ size_t len;
28+ len = strlen(argv[arg_index]) + 1;
29+ if (len > UINT16_MAX || TIFFSetField(tiff, TIFFFieldTag(fip),
30+ (uint16_t)len, argv[arg_index]) != 1)
31+ fprintf( stderr, "Failed to set %s=%s\n",
32+ TIFFFieldName(fip), argv[arg_index] );
33+ } else {
34+ if (TIFFSetField(tiff, TIFFFieldTag(fip),
35+ argv[arg_index]) != 1)
36+ fprintf( stderr, "Failed to set %s=%s\n",
37+ TIFFFieldName(fip), argv[arg_index] );
38+ }
39 } else if (TIFFFieldWriteCount(fip) > 0
40 || TIFFFieldWriteCount(fip) == TIFF_VARIABLE) {
41 int ret = 1;
42--
432.25.1
diff --git a/meta/recipes-multimedia/libtiff/tiff_4.3.0.bb b/meta/recipes-multimedia/libtiff/tiff_4.3.0.bb
index 6852758c6a..ef8e8460fb 100644
--- a/meta/recipes-multimedia/libtiff/tiff_4.3.0.bb
+++ b/meta/recipes-multimedia/libtiff/tiff_4.3.0.bb
@@ -9,7 +9,8 @@ LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=34da3db46fab7501992f9615d7e158cf"
9CVE_PRODUCT = "libtiff" 9CVE_PRODUCT = "libtiff"
10 10
11SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \ 11SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \
12 " 12 file://0001-tiffset-fix-global-buffer-overflow-for-ASCII-tags-wh.patch"
13
13SRC_URI[sha256sum] = "0e46e5acb087ce7d1ac53cf4f56a09b221537fc86dfc5daaad1c2e89e1b37ac8" 14SRC_URI[sha256sum] = "0e46e5acb087ce7d1ac53cf4f56a09b221537fc86dfc5daaad1c2e89e1b37ac8"
14 15
15# exclude betas 16# exclude betas