diff options
Diffstat (limited to 'meta/recipes-multimedia')
-rw-r--r-- | meta/recipes-multimedia/libtiff/files/0001-tiffset-fix-global-buffer-overflow-for-ASCII-tags-wh.patch | 52 | ||||
-rw-r--r-- | meta/recipes-multimedia/libtiff/tiff_4.1.0.bb | 1 |
2 files changed, 53 insertions, 0 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..31f867e000 --- /dev/null +++ b/meta/recipes-multimedia/libtiff/files/0001-tiffset-fix-global-buffer-overflow-for-ASCII-tags-wh.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From b12a0326e6064b6e0b051d1184a219877472f69b Mon Sep 17 00:00:00 2001 | ||
2 | From: 4ugustus <wangdw.augustus@qq.com> | ||
3 | Date: Tue, 25 Jan 2022 16:25:28 +0000 | ||
4 | Subject: [PATCH] tiffset: fix global-buffer-overflow for ASCII tags where | ||
5 | count is required (fixes #355) | ||
6 | |||
7 | CVE: CVE-2022-22844 | ||
8 | Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/commit/03047a26952a82daaa0792957ce211e0aa51bc64] | ||
9 | Signed-off-by: Purushottam Choudhary <purushottam.choudhary@kpit.com> | ||
10 | Signed-off-by: Purushottam Choudhary <purushottamchoudhary29@gmail.com> | ||
11 | Comments: Add header stdint.h in tiffset.c explicitly for UINT16_MAX | ||
12 | --- | ||
13 | tools/tiffset.c | 17 ++++++++++++++--- | ||
14 | 1 file changed, 14 insertions(+), 3 deletions(-) | ||
15 | |||
16 | diff --git a/tools/tiffset.c b/tools/tiffset.c | ||
17 | index 8c9e23c5..e7a88c09 100644 | ||
18 | --- a/tools/tiffset.c | ||
19 | +++ b/tools/tiffset.c | ||
20 | @@ -33,6 +33,7 @@ | ||
21 | #include <string.h> | ||
22 | #include <stdlib.h> | ||
23 | |||
24 | +#include <stdint.h> | ||
25 | #include "tiffio.h" | ||
26 | |||
27 | static char* usageMsg[] = { | ||
28 | @@ -146,9 +146,19 @@ main(int argc, char* argv[]) | ||
29 | |||
30 | arg_index++; | ||
31 | if (TIFFFieldDataType(fip) == TIFF_ASCII) { | ||
32 | - if (TIFFSetField(tiff, TIFFFieldTag(fip), argv[arg_index]) != 1) | ||
33 | - fprintf( stderr, "Failed to set %s=%s\n", | ||
34 | - TIFFFieldName(fip), argv[arg_index] ); | ||
35 | + if(TIFFFieldPassCount( fip )) { | ||
36 | + size_t len; | ||
37 | + len = strlen(argv[arg_index]) + 1; | ||
38 | + if (len > UINT16_MAX || TIFFSetField(tiff, TIFFFieldTag(fip), | ||
39 | + (uint16_t)len, argv[arg_index]) != 1) | ||
40 | + fprintf( stderr, "Failed to set %s=%s\n", | ||
41 | + TIFFFieldName(fip), argv[arg_index] ); | ||
42 | + } else { | ||
43 | + if (TIFFSetField(tiff, TIFFFieldTag(fip), | ||
44 | + argv[arg_index]) != 1) | ||
45 | + fprintf( stderr, "Failed to set %s=%s\n", | ||
46 | + TIFFFieldName(fip), argv[arg_index] ); | ||
47 | + } | ||
48 | } else if (TIFFFieldWriteCount(fip) > 0 | ||
49 | || TIFFFieldWriteCount(fip) == TIFF_VARIABLE) { | ||
50 | int ret = 1; | ||
51 | -- | ||
52 | GitLab | ||
diff --git a/meta/recipes-multimedia/libtiff/tiff_4.1.0.bb b/meta/recipes-multimedia/libtiff/tiff_4.1.0.bb index 43f210111d..0948bb4e2f 100644 --- a/meta/recipes-multimedia/libtiff/tiff_4.1.0.bb +++ b/meta/recipes-multimedia/libtiff/tiff_4.1.0.bb | |||
@@ -15,6 +15,7 @@ SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \ | |||
15 | file://001_support_patch_for_CVE-2020-35521_and_CVE-2020-35522.patch \ | 15 | file://001_support_patch_for_CVE-2020-35521_and_CVE-2020-35522.patch \ |
16 | file://002_support_patch_for_CVE-2020-35521_and_CVE-2020-35522.patch \ | 16 | file://002_support_patch_for_CVE-2020-35521_and_CVE-2020-35522.patch \ |
17 | file://CVE-2020-35521_and_CVE-2020-35522.patch \ | 17 | file://CVE-2020-35521_and_CVE-2020-35522.patch \ |
18 | file://0001-tiffset-fix-global-buffer-overflow-for-ASCII-tags-wh.patch \ | ||
18 | " | 19 | " |
19 | SRC_URI[md5sum] = "2165e7aba557463acc0664e71a3ed424" | 20 | SRC_URI[md5sum] = "2165e7aba557463acc0664e71a3ed424" |
20 | SRC_URI[sha256sum] = "5d29f32517dadb6dbcd1255ea5bbc93a2b54b94fbf83653b4d65c7d6775b8634" | 21 | SRC_URI[sha256sum] = "5d29f32517dadb6dbcd1255ea5bbc93a2b54b94fbf83653b4d65c7d6775b8634" |