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

 
 

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

bug #46572: Use after free in T1_Done_Metrics.

Submitter:  bungeman <bungeman>
Submitted:  Mon 30 Nov 2015 03:40:28 PM UTC
   
 
Severity:  3 - Normal Item Group:  Incorrect behaviour
Status:  Fixed Privacy:  Public
Assigned to:  wl Open/Closed:  Closed
Planned Release:  2.6.3

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

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

Werner LEMBERG <wl>
Group administrator
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.)

 

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 bungeman (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
    2015-12-01 wl StatusNone Fixed
        Assigned toNone wl
        Open/ClosedOpen Closed
        Planned ReleaseNone 2.6.3
    2015-11-30 bungeman Attached File- Added crash-af9d27f31c039d6d22603b30d77608b34149d3a3, #35599
        Attached File- Added crash-af9d27f31c039d6d22603b30d77608b34149d3a3.txt, #35600

    Back to the top

    Powered by Savane 3.14-d582.
    Corresponding source code