bugThe FreeType Project - Bugs: bug #35646, Invalid (out-of-bounds?) read in...

 
 

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

bug #35646: Invalid (out-of-bounds?) read in Ins_MIRP

Submitter:  Mateusz Jurczyk <j00ru>
Submitted:  Mon 27 Feb 2012 09:44:19 PM UTC
   
 
Severity:  3 - Normal Item Group:  Crash
Status:  Fixed Privacy:  Public
Assigned to:  wl Open/Closed:  Closed
Planned Release:  2.4.9

Thu 01 Mar 2012 08:32:33 PM UTC, comment #1: 

Fixed in git, thanks.

Werner LEMBERG <wl>
Group administrator
Mon 27 Feb 2012 09:44:19 PM UTC, original submission:  


Crash tested with ftbench (current git branch of freetype2 and ft2demos), compiled under Ubuntu amd64 with AddressSanitizer (http://code.google.com/p/address-sanitizer/).

Crashlog from ASAN:


Load                      : =================================================================
==13899== ERROR: AddressSanitizer heap-buffer-overflow on address 0x7fb6abdea080 at pc 0x4bb5e2 bp 0x7fffecae4650 sp 0x7fffecae4648
READ of size 1 at 0x7fb6abdea080 thread T0
  #0 0x4bb5e2 Ins_MIRP
  #1 0x4adb7c TT_RunIns
  #2 0x4cead9 TT_Hint_Glyph
  #3 0x4cc9bd TT_Process_Simple_Glyph
  #4 0x4c7ec5 load_truetype_glyph
  #5 0x4c578b TT_Load_Glyph
  #6 0x48934c FT_Load_Glyph
  #7 0x485be3 test_load
  #8 0x485a1e benchmark
  #9 0x488144 main
  #10 0x7fb6ac9f9d5d __libc_start_main
0x7fb6abdea080 is located 128 bytes to the right of 0-byte region [0x7fb6abdea000,0x7fb6abdea000)
freed by thread T0 here:
previously allocated by thread T0 here:
==13899== ABORTING
Stats: 1M malloced (0M for red zones) by 763 calls
Stats: 0M realloced by 22 calls
Stats: 0M freed by 56 calls
Stats: 0M really freed by 0 calls
Stats: 36M (9221 full pages) mmaped in 9 calls
  mmaps   by size class: 8:16383; 9:8191; 10:4095; 11:2047; 12:1024; 13:512; 15:128; 17:32; 19:8;
  mallocs by size class: 8:700; 9:21; 10:11; 11:16; 12:6; 13:1; 15:3; 17:1; 19:4;
  frees   by size class: 8:30; 9:4; 10:9; 11:8; 12:3; 13:1; 19:1;
  rfrees  by size class:
Stats: malloc large: 5 small slow: 8
Shadow byte and word:
  0x1ff6d57bd410: fa
  0x1ff6d57bd410: fa fa fa fa fa fa fa fa
More shadow bytes:
  0x1ff6d57bd3f0: fa fa fa fa fa fa fa fa
  0x1ff6d57bd3f8: fa fa fa fa fa fa fa fa
  0x1ff6d57bd400: fa fa fa fa fa fa fa fa
  0x1ff6d57bd408: fa fa fa fa fa fa fa fa
=>0x1ff6d57bd410: fa fa fa fa fa fa fa fa
  0x1ff6d57bd418: fa fa fa fa fa fa fa fa
  0x1ff6d57bd420: fa fa fa fa fa fa fa fa
  0x1ff6d57bd428: fa fa fa fa fa fa fa fa
  0x1ff6d57bd430: fa fa fa fa fa fa fa fa


Log from Valgrind:


==13380== Memcheck, a memory error detector
==13380== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==13380== Using Valgrind-3.8.0.SVN and LibVEX; rerun with -h for copyright info
==13380== Command: ./ftbench tmp/Norasi.dfont.asan.2.180
==13380==
Load                      : TT_Load_Simple_Glyph: too many instructions (19744)
==13380== Invalid read of size 8
==13380==    at 0x421DC4: Ins_MIRP (freetype2/src/truetype/ttinterp.c:6277)
==13380==    by 0x42562E: TT_RunIns (freetype2/src/truetype/ttinterp.c:8145)
==13380==    by 0x41CEF8: TT_Run_Context (freetype2/src/truetype/ttinterp.c:751)
==13380==    by 0x4175DD: TT_Hint_Glyph (freetype2/src/truetype/ttgload.c:799)
==13380==    by 0x417BB2: TT_Process_Simple_Glyph (freetype2/src/truetype/ttgload.c:920)
==13380==    by 0x418BF3: load_truetype_glyph (freetype2/src/truetype/ttgload.c:1408)
==13380==    by 0x419FEC: TT_Load_Glyph (freetype2/src/truetype/ttgload.c:2044)
==13380==    by 0x414DB1: tt_glyph_load (freetype2/src/truetype/ttdriver.c:334)
==13380==    by 0x4073F6: FT_Load_Glyph (freetype2/src/base/ftobjs.c:694)
==13380==    by 0x40177C: test_load (ft2demos-2.4.8/src/ftbench.c:221)
==13380==    by 0x4016B7: benchmark (ft2demos-2.4.8/src/ftbench.c:191)
==13380==    by 0x40274D: main (ft2demos-2.4.8/src/ftbench.c:794)
==13380==  Address 0x5854800 is not stack'd, malloc'd or (recently) free'd
==13380==
==13380== Invalid read of size 8
==13380==    at 0x421DCA: Ins_MIRP (freetype2/src/truetype/ttinterp.c:6277)
==13380==    by 0x42562E: TT_RunIns (freetype2/src/truetype/ttinterp.c:8145)
==13380==    by 0x41CEF8: TT_Run_Context (freetype2/src/truetype/ttinterp.c:751)
==13380==    by 0x4175DD: TT_Hint_Glyph (freetype2/src/truetype/ttgload.c:799)
==13380==    by 0x417BB2: TT_Process_Simple_Glyph (freetype2/src/truetype/ttgload.c:920)
==13380==    by 0x418BF3: load_truetype_glyph (freetype2/src/truetype/ttgload.c:1408)
==13380==    by 0x419FEC: TT_Load_Glyph (freetype2/src/truetype/ttgload.c:2044)
==13380==    by 0x414DB1: tt_glyph_load (freetype2/src/truetype/ttdriver.c:334)
==13380==    by 0x4073F6: FT_Load_Glyph (freetype2/src/base/ftobjs.c:694)
==13380==    by 0x40177C: test_load (ft2demos-2.4.8/src/ftbench.c:221)
==13380==    by 0x4016B7: benchmark (ft2demos-2.4.8/src/ftbench.c:191)
==13380==    by 0x40274D: main (ft2demos-2.4.8/src/ftbench.c:794)
==13380==  Address 0x5854808 is not stack'd, malloc'd or (recently) free'd
==13380==
TT_Load_Simple_Glyph: too many instructions (19744)
TT_Load_Simple_Glyph: too many instructions (19744)
TT_Load_Simple_Glyph: too many instructions (19744)
1318.004 us/op
Load_Advances (Normal)    : 26.778 us/op
Load_Advances (Fast)      : 1.967 us/op
Render                    : TT_Load_Simple_Glyph: too many instructions (19744)
ft_smooth_render_generic: glyph too large: 93 x 189546
TT_Load_Simple_Glyph: too many instructions (19744)
ft_smooth_render_generic: glyph too large: 93 x 189546
TT_Load_Simple_Glyph: too many instructions (19744)
ft_smooth_render_generic: glyph too large: 93 x 189546
TT_Load_Simple_Glyph: too many instructions (19744)
ft_smooth_render_generic: glyph too large: 93 x 189546
497.063 us/op
Get_Glyph                 : TT_Load_Simple_Glyph: too many instructions (19744)
TT_Load_Simple_Glyph: too many instructions (19744)
TT_Load_Simple_Glyph: too many instructions (19744)
TT_Load_Simple_Glyph: too many instructions (19744)
TT_Load_Simple_Glyph: too many instructions (19744)
73.750 us/op
Get_CBox                  : TT_Load_Simple_Glyph: too many instructions (19744)
TT_Load_Simple_Glyph: too many instructions (19744)
TT_Load_Simple_Glyph: too many instructions (19744)
TT_Load_Simple_Glyph: too many instructions (19744)
TT_Load_Simple_Glyph: too many instructions (19744)
25.248 us/op
Get_Char_Index            : 2.850 us/op
Iterate CMap              : 658.473 us/op
New_Face                  : 3747.695 us/op
Embolden                  : TT_Load_Simple_Glyph: too many instructions (19744)
TT_Load_Simple_Glyph: too many instructions (19744)
TT_Load_Simple_Glyph: too many instructions (19744)
TT_Load_Simple_Glyph: too many instructions (19744)
TT_Load_Simple_Glyph: too many instructions (19744)
12.483 us/op
==13380==
==13380== HEAP SUMMARY:
==13380==     in use at exit: 0 bytes in 0 blocks
==13380==   total heap usage: 52,158 allocs, 52,158 frees, 228,156,746 bytes allocated
==13380==
==13380== All heap blocks were freed -- no leaks are possible
==13380==
==13380== For counts of detected and suppressed errors, rerun with: -v
==13380== ERROR SUMMARY: 46 errors from 2 contexts (suppressed: 4 from 4)

Mateusz Jurczyk <j00ru>
Group Member

 

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

Attached Files
file #25196:  Norasi.dfont.asan.2.180 added by j00ru (106KiB - application/octet-stream)

 

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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-03-01 wl StatusNone Fixed
        PrivacyPrivate Public
        Assigned toNone wl
        Open/ClosedOpen Closed
        Planned ReleaseNone 2.4.9
    2012-02-27 j00ru Attached File- Added Norasi.dfont.asan.2.180, #25196

    Back to the top

    Powered by Savane 3.13-081f.
    Corresponding source code