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

 
 

bug #35657: Out-of-bounds read in PS_Conv_Strtol

Submitted by:  Mateusz Jurczyk <j00ru>
Submitted on:  Tue 28 Feb 2012 10:10:21 AM UTC  
 
Severity: 3 - NormalItem Group: Crash
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.4.9

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

Fixed in git, thanks.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Tue 28 Feb 2012 10:10:21 AM 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:

=================================================================
==18885== ERROR: AddressSanitizer heap-buffer-overflow on address 0x7fab358d636d at pc 0x5ade86 bp 0x7ffff8ac4de0 sp 0x7ffff8ac4dd8
READ of size 1 at 0x7fab358d636d thread T0
#0 0x5ade86 PS_Conv_Strtol
#1 0x5adc77 PS_Conv_ToInt
#2 0x5a2c87 ps_parser_to_int
#3 0x4d847c parse_subrs
#4 0x4e7c11 t1_load_keyword
#5 0x4e58ba parse_dict
#6 0x4e3335 T1_Open_Face
#7 0x4dc866 T1_Face_Init
#8 0x491460 open_face
#9 0x490a23 FT_Open_Face
#10 0x48fd46 FT_New_Face
#11 0x487407 get_face
#12 0x487b61 main
#13 0x7fab36d39d5d __libc_start_main
0x7fab358d636d is located 1 bytes to the right of 4844-byte region [0x7fab358d5080,0x7fab358d636c)
allocated by thread T0 here:
#0 0x5c62d2 malloc
#1 0x4a0ee4 ft_mem_qalloc
#2 0x48b2bf ft_mem_alloc
#3 0x4e61bd T1_Get_Private_Dict
#4 0x4e32b1 T1_Open_Face
#5 0x4dc866 T1_Face_Init
#6 0x491460 open_face
#7 0x490a23 FT_Open_Face
#8 0x48fd46 FT_New_Face
#9 0x487407 get_face
#10 0x487b61 main
#11 0x7fab36d39d5d __libc_start_main
==18885== ABORTING
Stats: 0M malloced (0M for red zones) by 756 calls
Stats: 0M realloced by 0 calls
Stats: 0M freed by 74 calls
Stats: 0M really freed by 0 calls
Stats: 28M (7171 full pages) mmaped in 7 calls
mmaps by size class: 8:16383; 9:8191; 10:4095; 11:2047; 12:1024; 13:512; 15:128;
mallocs by size class: 8:723; 9:19; 10:3; 11:7; 12:2; 13:1; 15:1;
frees by size class: 8:63; 9:7; 10:1; 11:2; 12:1;
rfrees by size class:
Stats: malloc large: 0 small slow: 8
Shadow byte and word:
0x1ff566b1ac6d: 4
0x1ff566b1ac68: 00 00 00 00 00 04 fb fb
More shadow bytes:
0x1ff566b1ac48: 00 00 00 00 00 00 00 00
0x1ff566b1ac50: 00 00 00 00 00 00 00 00
0x1ff566b1ac58: 00 00 00 00 00 00 00 00
0x1ff566b1ac60: 00 00 00 00 00 00 00 00
=>0x1ff566b1ac68: 00 00 00 00 00 04 fb fb
0x1ff566b1ac70: fa fa fa fa fa fa fa fa
0x1ff566b1ac78: fa fa fa fa fa fa fa fa
0x1ff566b1ac80: fa fa fa fa fa fa fa fa
0x1ff566b1ac88: fa fa fa fa fa fa fa fa

Log from Valgrind:

==19030== Memcheck, a memory error detector
==19030== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==19030== Using Valgrind-3.8.0.SVN and LibVEX; rerun with -h for copyright info
==19030== Command: ./ftbench tmp/freetype_run2/nimbus_roman_i.pfb.asan.66.764
==19030==
==19030== Invalid read of size 1
==19030== at 0x493208: PS_Conv_Strtol (freetype2/src/psaux/psconv.c:85)
==19030== by 0x49332D: PS_Conv_ToInt (freetype2/src/psaux/psconv.c:128)
==19030== by 0x48E9ED: ps_parser_to_int (freetype2/src/psaux/psobjs.c:1307)
==19030== by 0x42C2F9: parse_subrs (freetype2/src/type1/t1load.c:1397)
==19030== by 0x42B595: t1_load_keyword (freetype2/src/type1/t1load.c:930)
==19030== by 0x42D6C1: parse_dict (freetype2/src/type1/t1load.c:1970)
==19030== by 0x42DAB0: T1_Open_Face (freetype2/src/type1/t1load.c:2087)
==19030== by 0x42E778: T1_Face_Init (freetype2/src/type1/t1objs.c:339)
==19030== by 0x407F6F: open_face (freetype2/src/base/ftobjs.c:1153)
==19030== by 0x4097F3: FT_Open_Face (freetype2/src/base/ftobjs.c:2080)
==19030== by 0x40808C: FT_New_Face (freetype2/src/base/ftobjs.c:1215)
==19030== by 0x402302: get_face (ft2demos-2.4.8/src/ftbench.c:624)
==19030== Address 0x565415d is 1 bytes after a block of size 4,844 alloc'd
==19030== at 0x4C2A4D6: malloc (coregrind/m_replacemalloc/vg_replace_malloc.c:263)
==19030== by 0x49441F: ft_alloc (freetype2/src/base/ftsystem.c:74)
==19030== by 0x413466: ft_mem_qalloc (freetype2/src/base/ftutil.c:76)
==19030== by 0x4133EE: ft_mem_alloc (freetype2/src/base/ftutil.c:55)
==19030== by 0x428FC2: T1_Get_Private_Dict (freetype2/src/type1/t1parse.c:307)
==19030== by 0x42DA70: T1_Open_Face (freetype2/src/type1/t1load.c:2083)
==19030== by 0x42E778: T1_Face_Init (freetype2/src/type1/t1objs.c:339)
==19030== by 0x407F6F: open_face (freetype2/src/base/ftobjs.c:1153)
==19030== by 0x4097F3: FT_Open_Face (freetype2/src/base/ftobjs.c:2080)
==19030== by 0x40808C: FT_New_Face (freetype2/src/base/ftobjs.c:1215)
==19030== by 0x402302: get_face (ft2demos-2.4.8/src/ftbench.c:624)
==19030== by 0x4025F4: main (ft2demos-2.4.8/src/ftbench.c:752)
==19030==
==19030== Invalid read of size 1
==19030== at 0x493213: PS_Conv_Strtol (freetype2/src/psaux/psconv.c:85)
==19030== by 0x49332D: PS_Conv_ToInt (freetype2/src/psaux/psconv.c:128)
==19030== by 0x48E9ED: ps_parser_to_int (freetype2/src/psaux/psobjs.c:1307)
==19030== by 0x42C2F9: parse_subrs (freetype2/src/type1/t1load.c:1397)
==19030== by 0x42B595: t1_load_keyword (freetype2/src/type1/t1load.c:930)
==19030== by 0x42D6C1: parse_dict (freetype2/src/type1/t1load.c:1970)
==19030== by 0x42DAB0: T1_Open_Face (freetype2/src/type1/t1load.c:2087)
==19030== by 0x42E778: T1_Face_Init (freetype2/src/type1/t1objs.c:339)
==19030== by 0x407F6F: open_face (freetype2/src/base/ftobjs.c:1153)
==19030== by 0x4097F3: FT_Open_Face (freetype2/src/base/ftobjs.c:2080)
==19030== by 0x40808C: FT_New_Face (freetype2/src/base/ftobjs.c:1215)
==19030== by 0x402302: get_face (ft2demos-2.4.8/src/ftbench.c:624)
==19030== Address 0x565415d is 1 bytes after a block of size 4,844 alloc'd
==19030== at 0x4C2A4D6: malloc (coregrind/m_replacemalloc/vg_replace_malloc.c:263)
==19030== by 0x49441F: ft_alloc (freetype2/src/base/ftsystem.c:74)
==19030== by 0x413466: ft_mem_qalloc (freetype2/src/base/ftutil.c:76)
==19030== by 0x4133EE: ft_mem_alloc (freetype2/src/base/ftutil.c:55)
==19030== by 0x428FC2: T1_Get_Private_Dict (freetype2/src/type1/t1parse.c:307)
==19030== by 0x42DA70: T1_Open_Face (freetype2/src/type1/t1load.c:2083)
==19030== by 0x42E778: T1_Face_Init (freetype2/src/type1/t1objs.c:339)
==19030== by 0x407F6F: open_face (freetype2/src/base/ftobjs.c:1153)
==19030== by 0x4097F3: FT_Open_Face (freetype2/src/base/ftobjs.c:2080)
==19030== by 0x40808C: FT_New_Face (freetype2/src/base/ftobjs.c:1215)
==19030== by 0x402302: get_face (ft2demos-2.4.8/src/ftbench.c:624)
==19030== by 0x4025F4: main (ft2demos-2.4.8/src/ftbench.c:752)
==19030==
read_binary_data: invalid size field
couldn't load font resource
==19030==
==19030== HEAP SUMMARY:
==19030== in use at exit: 0 bytes in 0 blocks
==19030== total heap usage: 121 allocs, 121 frees, 44,946 bytes allocated
==19030==
==19030== All heap blocks were freed -- no leaks are possible
==19030==
==19030== For counts of detected and suppressed errors, rerun with: -v
==19030== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 4 from 4)

Mateusz Jurczyk <j00ru>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #25203:  nimbus_roman_i.pfb.asan.66.764 added by j00ru (44KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 01 Mar 2012 08:33:04 PM UTCwlStatusNone=>Fixed
      PrivacyPrivate=>Public
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.4.9
    Tue 28 Feb 2012 10:10:21 AM UTCj00ruAttached File-=>Added nimbus_roman_i.pfb.asan.66.764, #25203

    Back to the top


    Powered by Savane 3.1-cleanup1