Skip to content

Commit 0c97fca

Browse files
Patch libtiff for CVE-2025-8534
1 parent 0c9474d commit 0c97fca

File tree

2 files changed

+65
-1
lines changed

2 files changed

+65
-1
lines changed

SPECS/libtiff/CVE-2025-8534.patch

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
From fc4ebc5b677362b31817f71e8c155d186f8efaa7 Mon Sep 17 00:00:00 2001
2+
From: Su_Laus <[email protected]>
3+
Date: Sat, 2 Aug 2025 18:55:54 +0200
4+
Subject: [PATCH] tiff2ps: check return of TIFFGetFiled() for
5+
TIFFTAG_STRIPBYTECOUNTS and TIFFTAG_TILEBYTECOUNTS to avoid NULL pointer
6+
dereference.
7+
8+
Closes #718
9+
10+
Signed-off-by: Azure Linux Security Servicing Account <[email protected]>
11+
Upstream-reference: https://gitlab.com/libtiff/libtiff/-/commit/6ba36f159fd396ad11bf6b7874554197736ecc8b.patch
12+
---
13+
tools/unsupported/tiff2ps.c | 20 +++++++++++++++++---
14+
1 file changed, 17 insertions(+), 3 deletions(-)
15+
16+
diff --git a/tools/unsupported/tiff2ps.c b/tools/unsupported/tiff2ps.c
17+
index 541495d..d6a54b4 100644
18+
--- a/tools/unsupported/tiff2ps.c
19+
+++ b/tools/unsupported/tiff2ps.c
20+
@@ -2432,12 +2432,22 @@ int PS_Lvl2page(FILE *fd, TIFF *tif, uint32_t w, uint32_t h)
21+
if (tiled_image)
22+
{
23+
num_chunks = TIFFNumberOfTiles(tif);
24+
- TIFFGetField(tif, TIFFTAG_TILEBYTECOUNTS, &bc);
25+
+ if (!TIFFGetField(tif, TIFFTAG_TILEBYTECOUNTS, &bc))
26+
+ {
27+
+ TIFFError(filename,
28+
+ "Can't read bytecounts of tiles at PS_Lvl2page()");
29+
+ return (FALSE);
30+
+ }
31+
}
32+
else
33+
{
34+
num_chunks = TIFFNumberOfStrips(tif);
35+
- TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc);
36+
+ if (!TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc))
37+
+ {
38+
+ TIFFError(filename,
39+
+ "Can't read bytecounts of strips at PS_Lvl2page()");
40+
+ return (FALSE);
41+
+ }
42+
}
43+
44+
if (use_rawdata)
45+
@@ -3107,7 +3117,11 @@ void PSRawDataBW(FILE *fd, TIFF *tif, uint32_t w, uint32_t h)
46+
(void)w;
47+
(void)h;
48+
TIFFGetFieldDefaulted(tif, TIFFTAG_FILLORDER, &fillorder);
49+
- TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc);
50+
+ if (!TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc))
51+
+ {
52+
+ TIFFError(filename, "Can't read bytecounts of strips at PSRawDataBW()");
53+
+ return;
54+
+ }
55+
56+
/*
57+
* Find largest strip:
58+
--
59+
2.45.4
60+

SPECS/libtiff/libtiff.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: TIFF libraries and associated utilities.
22
Name: libtiff
33
Version: 4.6.0
4-
Release: 6%{?dist}
4+
Release: 7%{?dist}
55
License: libtiff
66
Vendor: Microsoft Corporation
77
Distribution: Azure Linux
@@ -13,6 +13,7 @@ Patch1: CVE-2023-6277.patch
1313
Patch2: CVE-2024-7006.patch
1414
Patch3: CVE-2023-3164.patch
1515
Patch4: CVE-2023-6228.patch
16+
Patch5: CVE-2025-8534.patch
1617

1718
BuildRequires: autoconf
1819
BuildRequires: automake
@@ -66,6 +67,9 @@ make %{?_smp_mflags} -k check
6667
%{_docdir}/*
6768

6869
%changelog
70+
* Tue Aug 05 2025 Azure Linux Security Servicing Account <[email protected]> - 4.6.0-7
71+
- Patch for CVE-2025-8534
72+
6973
* Mon Feb 03 2025 Ankita Pareek <[email protected]> - 4.6.0-6
7074
- Address CVE-2023-6228 with a patch
7175

0 commit comments

Comments
 (0)