Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 611672

Summary: x11-libs/gdk-pixbuf: (CVE-2017-6312) Possible out-of-bounds read or undefined behavior in io-ico.c
Product: Gentoo Security Reporter: Ian Zimmerman <nobrowser>
Component: VulnerabilitiesAssignee: Gentoo Security <security>
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---

Description Ian Zimmerman 2017-03-04 01:40:57 UTC
According to the upstream tracker (see ${URL}):

Before the patch to bug 313818 ( it was clear it was possible to overflow State->HeaderSize in io-ico.c. See line 334:

State->HeaderSize = entry->DIBoffset + INFOHEADER_SIZE;

So a check of (State->HeaderSize < 0) was added after this operation. However, I noticed that with optimization compilation flags, this check never took place. Specifically when the project was compiled with gcc with the flags "-O1 -fstrict-overflow -ftree-vrp" (or anything including these, such as -O2 or -O3). You can read about these flags to understand why this happens.

This is a problem because I know that many distributions do default to allowing optimizations when building packages and I believe the default of JHBuild is to compile with -O2.

This leads to a possible out-of-bounds read of BIH later in line 362
From line 359:
BIH = Data+entry->DIBoffset;

Reproducible: Always
Comment 1 Agostino Sarubbo gentoo-dev 2017-03-04 10:59:36 UTC

*** This bug has been marked as a duplicate of bug 611390 ***