bugThe FreeType Project - Bugs: bug #41692, Out-of-bounds read in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #41692: Out-of-bounds read in _bdf_parse_properties

Submitter:  Mateusz Jurczyk <j00ru>
Submitted:  Tue 25 Feb 2014 07:07:04 PM UTC
   
 
Severity:  3 - Normal Item Group:  Crash
Status:  Fixed Privacy:  Public
Assigned to:  wl Open/Closed:  Closed
Planned Release:  2.5.3

Wed 26 Feb 2014 12:09:55 PM UTC, comment #1: 

Fixed in git.  Please test!  And thanks for the report.

Werner LEMBERG <wl>
Group administrator
Tue 25 Feb 2014 07:07:04 PM UTC, original submission:  

Tested on Ubuntu AMD64 with upstream FreeType2 and FreeType2-demos, reproduced with ./ftbench <file>:

=================================================================
==23456==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x619000001d80 at pc 0x4616c9 bp 0x7fff74ea3130 sp 0x7fff74ea3100
READ of size 21 at 0x619000001d80 thread T0
    #0 0x4616c8 in __interceptor_memcmp llvm/projects/compiler-rt/lib/asan/asan_interceptors.cc:315
    #1 0x7e6651 in _bdf_parse_properties freetype2/src/bdf/bdflib.c:2023
    #2 0x7da496 in _bdf_readstream freetype2/src/bdf/bdflib.c:776
    #3 0x7d142d in bdf_load_font freetype2/src/bdf/bdflib.c:2393
    #4 0x7c612e in BDF_Face_Init freetype2/src/bdf/bdfdrivr.c:364
    #5 0x4c95ce in open_face freetype2/src/base/ftobjs.c:1191
    #6 0x4c57cd in FT_Open_Face freetype2/src/base/ftobjs.c:2123
    #7 0x4c3ca4 in FT_New_Face freetype2/src/base/ftobjs.c:1254
    #8 0x491d0f in get_face freetype2-demos/src/ftbench.c:705
    #9 0x48e6c4 in main freetype2-demos/src/ftbench.c:924

0x619000001d80 is located 0 bytes to the right of 1024-byte region [0x619000001980,0x619000001d80)
allocated by thread T0 here:
    #0 0x474821 in __interceptor_malloc llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74
    #1 0xa6611f in ft_alloc freetype2/src/base/ftsystem.c:74
    #2 0x519409 in ft_mem_qalloc freetype2/src/base/ftutil.c:76
    #3 0x4aef33 in ft_mem_alloc freetype2/src/base/ftutil.c:55
    #4 0x526d4c in ft_mem_qrealloc freetype2/src/base/ftutil.c:146
    #5 0x4b1155 in ft_mem_realloc freetype2/src/base/ftutil.c:102
    #6 0x7d8ba6 in _bdf_readstream freetype2/src/bdf/bdflib.c:687
    #7 0x7d142d in bdf_load_font freetype2/src/bdf/bdflib.c:2393
    #8 0x7c612e in BDF_Face_Init freetype2/src/bdf/bdfdrivr.c:364
    #9 0x4c95ce in open_face freetype2/src/base/ftobjs.c:1191
    #10 0x4c57cd in FT_Open_Face freetype2/src/base/ftobjs.c:2123
    #11 0x4c3ca4 in FT_New_Face freetype2/src/base/ftobjs.c:1254
    #12 0x491d0f in get_face freetype2-demos/src/ftbench.c:705
    #13 0x48e6c4 in main freetype2-demos/src/ftbench.c:924

SUMMARY: AddressSanitizer: heap-buffer-overflow llvm/projects/compiler-rt/lib/asan/asan_interceptors.cc:315 __interceptor_memcmp
Shadow bytes around the buggy address:
  0x0c327fff8360: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c327fff8370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c327fff8380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c327fff8390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c327fff83a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c327fff83b0:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c327fff83c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c327fff83d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c327fff83e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c327fff83f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c327fff8400: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Sta==23456==ABORTING

Mateusz Jurczyk <j00ru>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #30693:  asan_heap-oob_461759_5052_cu-lig12.bdf added by j00ru (11KiB - application/x-font-bdf)
file #30694:  asan_heap-oob_461759_1271_9x18grkm.bdf added by j00ru (28KiB - application/x-font-bdf)
file #30695:  asan_heap-oob_461759_9797_vbee-36.bdf added by j00ru (24KiB - application/x-font-bdf)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by wl (Posted a comment)
  • -email is unavailable- added by j00ru (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-02-26 wl StatusNone Fixed
        PrivacyPrivate Public
        Assigned toNone wl
        Open/ClosedOpen Closed
        Planned ReleaseNone 2.5.3
    2014-02-25 j00ru Attached File- Added asan_heap-oob_461759_5052_cu-lig12.bdf, #30693
        Attached File- Added asan_heap-oob_461759_1271_9x18grkm.bdf, #30694
        Attached File- Added asan_heap-oob_461759_9797_vbee-36.bdf, #30695

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code