Bug 603081 - libtiff: OOB read in putcontig8bitYCbCr11tile
libtiff: OOB read in putcontig8bitYCbCr11tile
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libtiff (Show other bugs)
6.0
All Linux
medium Severity medium
: rc
: ---
Assigned To: Tom Lane
Martin Cermak
:
Depends On:
Blocks: CVE-2010-2483
  Show dependency treegraph
 
Reported: 2010-06-11 09:45 EDT by Tomas Hoger
Modified: 2013-07-02 23:29 EDT (History)
6 users (show)

See Also:
Fixed In Version: libtiff-3.9.4-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-11-10 16:04:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Launchpad 591605 None None None Never

  None (edit)
Description Tomas Hoger 2010-06-11 09:45:32 EDT
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 09:50:53 EDT
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 10:13:06 EDT
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 12:17:19 EDT
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 12:22:56 EDT
Comment #0 fails to spell out a test case ... try this:

tiff2rgba lp591605-sample.tif /dev/null
Comment 8 Tomas Hoger 2010-06-16 14:20:36 EDT
Opening bug, original launchpad report is public now.
Comment 9 Tom Lane 2010-06-16 18:30:22 EDT
Filed upstream at http://bugzilla.maptools.org/show_bug.cgi?id=2216
Comment 11 Vincent Danen 2010-07-06 10:52:19 EDT
This issue was assigned CVE-2010-2483
Comment 14 Martin Cermak 2010-09-08 10:10:02 EDT
=> VERIFIED
Comment 15 releng-rhel@redhat.com 2010-11-10 16:04:39 EST
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.