Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 611672 - x11-libs/gdk-pixbuf: (CVE-2017-6312) Possible out-of-bounds read or undefined behavior in io-ico.c
Summary: x11-libs/gdk-pixbuf: (CVE-2017-6312) Possible out-of-bounds read or undefined...
Status: RESOLVED DUPLICATE of bug 611390
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Security
URL: https://bugzilla.gnome.org/show_bug.c...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-04 01:40 UTC by Ian Zimmerman
Modified: 2017-03-04 10:59 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Zimmerman 2017-03-04 01:40:57 UTC
According to the upstream tracker (see ${URL}):

Before the patch to bug 313818 (https://bugzilla.gnome.org/show_bug.cgi?id=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 ***