diff options
| author | Ross Burton <ross@burtonini.com> | 2022-01-25 17:58:25 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-01-26 06:27:00 +0000 |
| commit | 0e1d27b69dddd5d5e7c9a901f85da3e592d6d376 (patch) | |
| tree | 1d1c2dc1eb6c06da88e8393a28720eb8fbf1c06f /meta/recipes-multimedia | |
| parent | e8e1e829f47f31bd073937ced77ec26bb177a3ae (diff) | |
| download | poky-0e1d27b69dddd5d5e7c9a901f85da3e592d6d376.tar.gz | |
tiff: backport fix for CVE-2022-22844
(From OE-Core rev: daf2880b7431aa641e02ebba8cbca40d81389088)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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 | 43 | ||||
| -rw-r--r-- | meta/recipes-multimedia/libtiff/tiff_4.3.0.bb | 3 |
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 @@ | |||
| 1 | CVE: CVE-2022-22844 | ||
| 2 | Upstream-Status: Backport | ||
| 3 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
| 4 | |||
| 5 | From b12a0326e6064b6e0b051d1184a219877472f69b Mon Sep 17 00:00:00 2001 | ||
| 6 | From: 4ugustus <wangdw.augustus@qq.com> | ||
| 7 | Date: Tue, 25 Jan 2022 16:25:28 +0000 | ||
| 8 | Subject: [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 | |||
| 15 | diff --git a/tools/tiffset.c b/tools/tiffset.c | ||
| 16 | index 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 | -- | ||
| 43 | 2.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" | |||
| 9 | CVE_PRODUCT = "libtiff" | 9 | CVE_PRODUCT = "libtiff" |
| 10 | 10 | ||
| 11 | SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \ | 11 | SRC_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 | |||
| 13 | SRC_URI[sha256sum] = "0e46e5acb087ce7d1ac53cf4f56a09b221537fc86dfc5daaad1c2e89e1b37ac8" | 14 | SRC_URI[sha256sum] = "0e46e5acb087ce7d1ac53cf4f56a09b221537fc86dfc5daaad1c2e89e1b37ac8" |
| 14 | 15 | ||
| 15 | # exclude betas | 16 | # exclude betas |
