bugThe FreeType Project - Bugs: bug #46572, Use after free in T1_Done_Metrics.

 
 

bug #46572: Use after free in T1_Done_Metrics.

Submitted by:  bungeman <bungeman>
Submitted on:  Mon 30 Nov 2015 03:40:28 PM UTC  
 
Severity: 3 - NormalItem Group: Incorrect behaviour
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.6.3

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Tue 01 Dec 2015 11:11:27 AM UTC, comment #1:

Thanks for your analysis! Fixed in git, following your guidelines.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Mon 30 Nov 2015 03:40:28 PM UTC, original submission:

Found with libFuzzer at FreeType 4a15013a2988206cb126d6bc550e06f975439a13 while running ftfuzzer.cc, reproduction attached.

The AddressSanitizer report is in the attached 'txt' file, and the reproduction is in the similarly named non-'txt' file. Note that the reproduction file here is actually a 'tar' archive with three files in it.

It appears the issue is that in T1_Read_Metrics after calling T1_Done_Metrics (early on, in the 'if ( face->afm_data )' block) that face->afm_data should be set to NULL. Currently it is not, so when a subsequent invalid metrics file is attached the current metrics are freed, but face->afm_data is now a dangling pointer since it wasn't re-assigned. Another approach might be to do the check and free the old metrics only when the new metrics are about to be assigned to face->afm_data inside the 'if ( fi->NumKernPair )' block.

I believe this issue was introduced with FreeType 3c582060 .

bungeman <bungeman>

 

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

Attach File(s):
   
   
Comment:
   

 

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 bungeman (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
    Tue 01 Dec 2015 11:11:27 AM UTCwlStatusNone=>Fixed
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.6.3
    Mon 30 Nov 2015 03:40:28 PM UTCbungemanAttached File-=>Added crash-af9d27f31c039d6d22603b30d77608b34149d3a3, #35599
      Attached File-=>Added crash-af9d27f31c039d6d22603b30d77608b34149d3a3.txt, #35600

    Back to the top


    Powered by Savane 3.1-cleanup1