Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions SPECS/libtiff/CVE-2025-8851.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
From 43143771f76f7d2d922ed5002ad4401666231c0b Mon Sep 17 00:00:00 2001
From: Lee Howard <[email protected]>
Date: Sun, 11 Aug 2024 16:01:07 +0000
Subject: [PATCH] Attempt to address tiffcrop Coverity scan issues 1605444,
1605445, and 1605449.

Signed-off-by: Azure Linux Security Servicing Account <[email protected]>
Upstream-reference: https://gitlab.com/libtiff/libtiff/-/commit/8a7a48d7a645992ca83062b3a1873c951661e2b3.patch
---
archive/tools/tiffcrop.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/archive/tools/tiffcrop.c b/archive/tools/tiffcrop.c
index d3365de..93f0779 100644
--- a/archive/tools/tiffcrop.c
+++ b/archive/tools/tiffcrop.c
@@ -5573,7 +5573,14 @@ static int readSeparateStripsIntoBuffer(TIFF *in, uint8_t *obuf,
buff = srcbuffs[s];
strip = (s * strips_per_sample) + j;
bytes_read = TIFFReadEncodedStrip(in, strip, buff, stripsize);
- rows_this_strip = (uint32_t)(bytes_read / src_rowsize);
+ if (bytes_read < 0)
+ {
+ rows_this_strip = 0;
+ }
+ else
+ {
+ rows_this_strip = (uint32_t)(bytes_read / src_rowsize);
+ }
if (bytes_read < 0 && !ignore)
{
TIFFError(TIFFFileName(in),
@@ -6002,7 +6009,7 @@ static int computeInputPixelOffsets(struct crop_mask *crop,
rmargin = _TIFFClampDoubleToUInt32(crop->margins[3] * scale * xres);
}

- if ((lmargin + rmargin) > image->width)
+ if (lmargin == 0xFFFFFFFFU || rmargin == 0xFFFFFFFFU || (lmargin + rmargin) > image->width)
{
TIFFError("computeInputPixelOffsets",
"Combined left and right margins exceed image width");
@@ -6010,7 +6017,7 @@ static int computeInputPixelOffsets(struct crop_mask *crop,
rmargin = (uint32_t)0;
return (-1);
}
- if ((tmargin + bmargin) > image->length)
+ if (tmargin == 0xFFFFFFFFU || bmargin == 0xFFFFFFFFU || (tmargin + bmargin) > image->length)
{
TIFFError("computeInputPixelOffsets",
"Combined top and bottom margins exceed image length");
@@ -6592,14 +6599,14 @@ static int computeOutputPixelOffsets(struct crop_mask *crop,
((image->bps + 7) / 8));
}

- if ((hmargin * 2.0) > (pwidth * page->hres))
+ if (hmargin == 0xFFFFFFFFU || (hmargin * 2.0) > (pwidth * page->hres))
{
TIFFError("computeOutputPixelOffsets",
"Combined left and right margins exceed page width");
hmargin = (uint32_t)0;
return (-1);
}
- if ((vmargin * 2.0) > (plength * page->vres))
+ if (vmargin == 0xFFFFFFFFU || (vmargin * 2.0) > (plength * page->vres))
{
TIFFError("computeOutputPixelOffsets",
"Combined top and bottom margins exceed page length");
--
2.45.4

6 changes: 5 additions & 1 deletion SPECS/libtiff/libtiff.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Summary: TIFF libraries and associated utilities.
Name: libtiff
Version: 4.6.0
Release: 7%{?dist}
Release: 8%{?dist}
License: libtiff
Vendor: Microsoft Corporation
Distribution: Azure Linux
Expand All @@ -16,6 +16,7 @@ Patch4: CVE-2023-6228.patch
Patch5: CVE-2025-8534.patch
Patch6: CVE-2025-8177.patch
Patch7: CVE-2025-8176.patch
Patch8: CVE-2025-8851.patch

BuildRequires: autoconf
BuildRequires: automake
Expand Down Expand Up @@ -72,6 +73,9 @@ make %{?_smp_mflags} -k check
%exclude %{_docdir}/tiff-%{version}/LICENSE.md

%changelog
* Thu Aug 14 2025 Azure Linux Security Servicing Account <[email protected]> - 4.6.0-8
- Patch for CVE-2025-8851

* Tue Aug 05 2025 Azure Linux Security Servicing Account <[email protected]> - 4.6.0-7
- Patch for CVE-2025-8534, CVE-2025-8177, CVE-2025-8176

Expand Down
Loading