Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1388866 - (CVE-2016-8882) CVE-2016-8882 jasper: uninitialized tile->pi pointer use in JPC decoder
CVE-2016-8882 jasper: uninitialized tile->pi pointer use in JPC decoder
Status: CLOSED NOTABUG
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
impact=moderate,public=20161017,repor...
: Security
Depends On: 1388873 1388874 1388875 1388876
Blocks: 1314477
  Show dependency treegraph
 
Reported: 2016-10-26 06:38 EDT by Adam Mariš
Modified: 2017-03-01 10:40 EST (History)
28 users (show)

See Also:
Fixed In Version: jasper 1.900.8
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-03-01 10:32:45 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Adam Mariš 2016-10-26 06:38:44 EDT
Null pointer access due to improper initialization was found in jpc_pi_destroy.

Upstream patch:

https://github.com/mdadams/jasper/commit/69a1439a5381e42b06ec6a06ed2675eb793babee

CVE assignment:

http://seclists.org/oss-sec/2016/q4/216
Comment 1 Adam Mariš 2016-10-26 06:50:50 EDT
Created mingw-jasper tracking bugs for this issue:

Affects: fedora-all [bug 1388874]
Affects: epel-7 [bug 1388876]
Comment 2 Adam Mariš 2016-10-26 06:51:07 EDT
Created jasper tracking bugs for this issue:

Affects: fedora-all [bug 1388873]
Affects: epel-5 [bug 1388875]
Comment 3 Tomas Hoger 2017-03-01 10:32:45 EST
Upstream bug report:

https://github.com/mdadams/jasper/issues/30

The problem was in the jpc_dec_process_siz() function, which did not initialize tile->pi.  Later on, when tile data was freed, non-NULL tile->pi led to the call of jpc_pi_destroy() function, which dereferenced and possibly tried to free uninitialized / invalid pointer.  That could cause crash, or could possibly lead to use-after-free or double free.

This issue did not affect jasper packages in Red Hat Enterprise Linux 6 and 7 because of the inclusion of the CVE-2008-3520 fix in those packages.  The patch makes jpc_dec_process_siz() function use calloc instead of malloc when allocating dec->tiles memory, using this change:

-    if (!(dec->tiles = jas_malloc(dec->numtiles * sizeof(jpc_dec_tile_t)))) {
+    if (!(dec->tiles = jas_calloc(dec->numtiles, sizeof(jpc_dec_tile_t)))) {

This was meant to protect against integer overflow when computing the amount of required memory allocation, but also has a side effect of initializing tile structure with zeros.  I.e. tile->pi is initialized to 0 / NULL, which is equivalent to the upstream fix for this issue.

This fix was also included in netpbm packages updates in Red Hat Enterprise Linux 4 and 5 via RHSA-2009:0012:

https://rhn.redhat.com/errata/RHSA-2009-0012.html

Note You need to log in before you can comment on or make changes to this bug.