Bug 1315308

Summary: php: Segmentation fault in mysql_driver.c
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: abhgupta, dmcphers, fedora, jialiu, jokerman, jorton, kseifried, lmeyer, mmaslano, mmccomas, rcollet, tiwillia, webstack-team
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: php 5.6.19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-13 17:49:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1315309    
Bug Blocks: 1315348    

Description Adam Mariš 2016-03-07 12:52:53 UTC
Segmentation fault in mysql_driver.c was found. When Z_TYPE is 0 (IS_NULL) then convert_to_string() returns value obtained from STR_EMPTY_ALLOC(). In turn, STR_EMPTY_ALLOC() returns a value of CG(interned_empty_string). Applying efree() on this value later causes crash. This issue was introduced by commit http://git.php.net/?p=php-src.git;a=commit;h=ef1bd8f0e6f88b1d123cea1c0b5079cfde7f90df

Upstream bug:

https://bugs.php.net/bug.php?id=71569

Upstream patch:

http://git.php.net/?p=php-src.git;a=commit;h=bc419fee5c9704eb4ce338acacbc2380c6f4427d

Comment 1 Adam Mariš 2016-03-07 12:54:05 UTC
Created php tracking bugs for this issue:

Affects: fedora-all [bug 1315309]

Comment 2 Remi Collet 2016-03-07 13:05:16 UTC
Please explain how this is considered as a security issue, especially as it requires some crafted script.

Comment 3 Tomas Hoger 2016-06-13 17:49:49 UTC
Agree this is not a security issue.

Additionally, it was identified in the upstream bug that the problem was only introduced via a fix for the following upstream bug:

https://bugs.php.net/bug.php?id=70389

first used in PHP version 5.6.14.