summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/libtiff/tiff/CVE-2023-25434-CVE-2023-25435.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-multimedia/libtiff/tiff/CVE-2023-25434-CVE-2023-25435.patch')
-rw-r--r--meta/recipes-multimedia/libtiff/tiff/CVE-2023-25434-CVE-2023-25435.patch94
1 files changed, 94 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/libtiff/tiff/CVE-2023-25434-CVE-2023-25435.patch b/meta/recipes-multimedia/libtiff/tiff/CVE-2023-25434-CVE-2023-25435.patch
new file mode 100644
index 0000000000..e214277504
--- /dev/null
+++ b/meta/recipes-multimedia/libtiff/tiff/CVE-2023-25434-CVE-2023-25435.patch
@@ -0,0 +1,94 @@
1From 69818e2f2d246e6631ac2a2da692c3706b849c38 Mon Sep 17 00:00:00 2001
2From: Su_Laus <sulau@freenet.de>
3Date: Sun, 29 Jan 2023 11:09:26 +0100
4Subject: [PATCH] CVE-2023-25434 & CVE-2023-25435
5
6tiffcrop: Amend rotateImage() not to toggle the input (main)
7image width and length parameters when only cropped image sections are
8rotated. Remove buffptr from region structure because never used.
9
10Closes #492 #493 #494 #495 #499 #518 #519
11
12Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/commit/69818e2f2d246e6631ac2a2da692c3706b849c38]
13CVE: CVE-2023-25434 & CVE-2023-25435
14Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
15---
16 tools/tiffcrop.c | 27 ++++++++++++++++-----------
17 1 file changed, 16 insertions(+), 11 deletions(-)
18
19diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c
20index cbd24cc..b811fbb 100644
21--- a/tools/tiffcrop.c
22+++ b/tools/tiffcrop.c
23@@ -523,7 +523,7 @@ static int rotateContigSamples24bits(uint16_t, uint16_t, uint16_t, uint32_t,
24 static int rotateContigSamples32bits(uint16_t, uint16_t, uint16_t, uint32_t,
25 uint32_t, uint32_t, uint8_t *, uint8_t *);
26 static int rotateImage(uint16_t, struct image_data *, uint32_t *, uint32_t *,
27- unsigned char **, size_t *);
28+ unsigned char **, size_t *, int);
29 static int mirrorImage(uint16_t, uint16_t, uint16_t, uint32_t, uint32_t,
30 unsigned char *);
31 static int invertImage(uint16_t, uint16_t, uint16_t, uint32_t, uint32_t,
32@@ -6513,10 +6513,11 @@ static int correct_orientation(struct image_data *image, unsigned char **work_b
33 /* Dummy variable in order not to switch two times the
34 * image->width,->length within rotateImage(),
35 * but switch xres, yres there. */
36- uint32_t width = image->width;
37- uint32_t length = image->length;
38- if (rotateImage(rotation, image, &width, &length, work_buff_ptr, NULL))
39- {
40+ uint32_t width = image->width;
41+ uint32_t length = image->length;
42+ if (rotateImage(rotation, image, &width, &length, work_buff_ptr, NULL,
43+ TRUE))
44+ {
45 TIFFError ("correct_orientation", "Unable to rotate image");
46 return (-1);
47 }
48@@ -7700,7 +7701,8 @@ processCropSelections(struct image_data *image, struct crop_mask *crop,
49 * accordingly. */
50 size_t rot_buf_size = 0;
51 if (rotateImage(crop->rotation, image, &crop->combined_width,
52- &crop->combined_length, &crop_buff, &rot_buf_size))
53+ &crop->combined_length, &crop_buff, &rot_buf_size,
54+ FALSE))
55 {
56 TIFFError("processCropSelections",
57 "Failed to rotate composite regions by %"PRIu32" degrees", crop->rotation);
58@@ -7811,9 +7813,10 @@ processCropSelections(struct image_data *image, struct crop_mask *crop,
59 * its size individually. Therefore, seg_buffs size needs to be
60 * updated accordingly. */
61 size_t rot_buf_size = 0;
62- if (rotateImage(
63- crop->rotation, image, &crop->regionlist[i].width,
64- &crop->regionlist[i].length, &crop_buff, &rot_buf_size))
65+ if (rotateImage(crop->rotation, image,
66+ &crop->regionlist[i].width,
67+ &crop->regionlist[i].length, &crop_buff,
68+ &rot_buf_size, FALSE))
69 {
70 TIFFError("processCropSelections",
71 "Failed to rotate crop region by %"PRIu16" degrees", crop->rotation);
72@@ -7943,7 +7946,7 @@ createCroppedImage(struct image_data *image, struct crop_mask *crop,
73 if (crop->crop_mode & CROP_ROTATE) /* rotate should be last as it can reallocate the buffer */
74 {
75 if (rotateImage(crop->rotation, image, &crop->combined_width,
76- &crop->combined_length, crop_buff_ptr, NULL))
77+ &crop->combined_length, crop_buff_ptr, NULL, TRUE))
78 {
79 TIFFError("createCroppedImage",
80 "Failed to rotate image or cropped selection by %"PRIu16" degrees", crop->rotation);
81@@ -8607,7 +8610,9 @@ rotateContigSamples32bits(uint16_t rotation, uint16_t spp, uint16_t bps, uint32_
82 static int
83 rotateImage(uint16_t rotation, struct image_data *image,
84 uint32_t *img_width,uint32_t *img_length,
85- unsigned char **ibuff_ptr, size_t *rot_buf_size)
86+ unsigned char **ibuff_ptr, size_t *rot_buf_size,
87+ int rot_image_params)
88+
89 {
90 int shift_width;
91 uint32_t bytes_per_pixel, bytes_per_sample;
92--
932.25.1
94