Bug 603081 - libtiff: OOB read in putcontig8bitYCbCr11tile
Summary: libtiff: OOB read in putcontig8bitYCbCr11tile
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libtiff
Version: 6.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Tom Lane
QA Contact: Martin Cermak
URL:
Whiteboard:
Depends On:
Blocks: CVE-2010-2483
TreeView+ depends on / blocked
 
Reported: 2010-06-11 13:45 UTC by Tomas Hoger
Modified: 2019-06-11 11:17 UTC (History)
6 users (show)

Fixed In Version: libtiff-3.9.4-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-10 21:04:39 UTC


Attachments (Terms of Use)
Reproducer (7.62 KB, application/x-gzip)
2010-06-11 13:50 UTC, Tomas Hoger
no flags Details
patch (449 bytes, patch)
2010-06-11 16:17 UTC, Tom Lane
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Launchpad 591605 None None None Never

Description Tomas Hoger 2010-06-11 13:45:32 UTC
Description of problem:
Originally reported by Sauli Pahlman in Launchpad:
  https://bugs.launchpad.net/bugs/591605

Attached tif file triggers out-of-bounds read in putcontig8bitYCbCr11tile.

pp points to buffer allocated in gtTileContig with the size of TIFFTileSize(tif).  For this file, it's 80640.  putcontig8bitYCbCr11tile tries to read w*h*3 bytes out of it (234*213*3 == 149526).

Version-Release number of selected component (if applicable):
libtiff-3.9.2-3.el6.i686

Additional info:

Program received signal SIGSEGV, Segmentation fault.
0x008a7e15 in putcontig8bitYCbCr11tile (img=<value optimized out>, cp=0xb7fed420, x=<value optimized out>, 
    y=<value optimized out>, w=<value optimized out>, h=<value optimized out>, fromskew=<value optimized out>, 
    toskew=<value optimized out>, pp=0x806d000 <Address 0x806d000 out of bounds>) at tif_getimage.c:1986
1986				YCbCrtoRGB(*cp++, pp[0]);

(gdb) bt
#0  0x008a7e15 in putcontig8bitYCbCr11tile (img=<value optimized out>, cp=0xb7fed420, x=<value optimized out>, 
    y=<value optimized out>, w=<value optimized out>, h=<value optimized out>, fromskew=<value optimized out>, 
    toskew=<value optimized out>, pp=0x806d000 <Address 0x806d000 out of bounds>) at tif_getimage.c:1986
#1  0x008aa52e in gtTileContig (img=<value optimized out>, raster=<value optimized out>, w=<value optimized out>, 
    h=<value optimized out>) at tif_getimage.c:629
#2  0x008a7103 in TIFFRGBAImageGet (img=<value optimized out>, raster=<value optimized out>, w=<value optimized out>, 
    h=<value optimized out>) at tif_getimage.c:461
#3  0x008ac750 in TIFFReadRGBAImageOriented (tif=<value optimized out>, rwidth=<value optimized out>, 
    rheight=<value optimized out>, raster=<value optimized out>, orientation=<value optimized out>, 
    stop=<value optimized out>) at tif_getimage.c:480
#4  0x080495c8 in cvt_whole_image (out=<value optimized out>, in=<value optimized out>) at tiff2rgba.c:401
#5  tiffcvt (out=<value optimized out>, in=<value optimized out>) at tiff2rgba.c:519
#6  main (out=<value optimized out>, in=<value optimized out>) at tiff2rgba.c:115

This may be related to bug #583081, however patches linked there do not address this problem.

Comment 1 Tomas Hoger 2010-06-11 13:50:53 UTC
Created attachment 423278 [details]
Reproducer

Test file from: https://bugs.launchpad.net/bugs/591605

Adding as private for now, while Launchpad bug is private.

Comment 4 RHEL Product and Program Management 2010-06-11 14:13:06 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 6 Tom Lane 2010-06-11 16:17:19 UTC
Created attachment 423329 [details]
patch

Specifically, what we need is this patch, which duplicates into PickContigCase() a safety check that already existed in PickSeparateCase().

Comment 7 Tom Lane 2010-06-11 16:22:56 UTC
Comment #0 fails to spell out a test case ... try this:

tiff2rgba lp591605-sample.tif /dev/null

Comment 8 Tomas Hoger 2010-06-16 18:20:36 UTC
Opening bug, original launchpad report is public now.

Comment 9 Tom Lane 2010-06-16 22:30:22 UTC
Filed upstream at http://bugzilla.maptools.org/show_bug.cgi?id=2216

Comment 11 Vincent Danen 2010-07-06 14:52:19 UTC
This issue was assigned CVE-2010-2483

Comment 14 Martin Cermak 2010-09-08 14:10:02 UTC
=> VERIFIED

Comment 15 releng-rhel@redhat.com 2010-11-10 21:04:39 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.