fix CVE-2023-52356: libtiff could crash in TIFFReadRGBATileExt when parsing crafted tiff file (RHEL-17337)
note: added missing patch, still expected to fail Resolves: RHEL-17337
This commit is contained in:
parent
22b43237f8
commit
2ffbd59c12
44
libtiff-4.4.0-CVE-2023-52356.patch
Normal file
44
libtiff-4.4.0-CVE-2023-52356.patch
Normal file
@ -0,0 +1,44 @@
|
||||
From 51558511bdbbcffdce534db21dbaf5d54b31638a Mon Sep 17 00:00:00 2001
|
||||
From: Even Rouault <even.rouault@spatialys.com>
|
||||
Date: Tue, 31 Oct 2023 15:58:41 +0100
|
||||
Subject: [PATCH] TIFFReadRGBAStrip/TIFFReadRGBATile: add more validation of
|
||||
col/row (fixes #622)
|
||||
|
||||
---
|
||||
libtiff/tif_getimage.c | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
|
||||
diff --git a/libtiff/tif_getimage.c b/libtiff/tif_getimage.c
|
||||
index 41f7dfd77..6fee35db2 100644
|
||||
--- a/libtiff/tif_getimage.c
|
||||
+++ b/libtiff/tif_getimage.c
|
||||
@@ -2943,6 +2943,14 @@ TIFFReadRGBAStripExt(TIFF* tif, uint32_t
|
||||
|
||||
if (TIFFRGBAImageOK(tif, emsg) && TIFFRGBAImageBegin(&img, tif, stop_on_error, emsg)) {
|
||||
|
||||
+ if (row >= img.height)
|
||||
+ {
|
||||
+ TIFFErrorExtR(tif, TIFFFileName(tif),
|
||||
+ "Invalid row passed to TIFFReadRGBAStrip().");
|
||||
+ TIFFRGBAImageEnd(&img);
|
||||
+ return (0);
|
||||
+ }
|
||||
+
|
||||
img.row_offset = row;
|
||||
img.col_offset = 0;
|
||||
|
||||
@@ -3018,6 +3026,14 @@ TIFFReadRGBATileExt(TIFF* tif, uint32_t
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
+ if (col >= img.width || row >= img.height)
|
||||
+ {
|
||||
+ TIFFErrorExtR(tif, TIFFFileName(tif),
|
||||
+ "Invalid row/col passed to TIFFReadRGBATile().");
|
||||
+ TIFFRGBAImageEnd(&img);
|
||||
+ return (0);
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* The TIFFRGBAImageGet() function doesn't allow us to get off the
|
||||
* edge of the image, even to fill an otherwise valid tile. So we
|
||||
Loading…
Reference in New Issue
Block a user