Bug 1433703

Summary: Double free in _ldap/servers/plugins/replication/cl5_api.c:cl5NewDBFile()
Product: Red Hat Enterprise Linux 7 Reporter: mreynolds
Component: 389-ds-baseAssignee: mreynolds
Status: CLOSED DUPLICATE QA Contact: Viktor Ashirov <vashirov>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: nhosoi, nkinder, rmeggins, vashirov
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1433697 Environment:
Last Closed: 2017-03-23 14:24:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1433697    
Bug Blocks:    

Description mreynolds 2017-03-19 12:14:14 UTC
+++ This bug was initially created as a clone of Bug #1433697 +++

This bug is created as a clone of upstream ticket:
https://pagure.io/389-ds-base/issue/49175

#### Issue Description
When fixing our freeipa cluster & redeploying of some replicas, I hit strange ns-slapd crashes. After little debugging & ASANning, I nailed down double-free in cl5NewDBFile error path. Patch is attached, feel free to ask me if you need more info.

#### Package Version and Platform
CentOS 7.2

$ rpm -q 389-ds-base
389-ds-base-1.3.5.10-11.x86_64

#### Steps to reproduce

1. Fill IPC semaphore table (/usr/bin/ipcs) - in my case all available semaphores were consumed by httpd
2. Try to setup replication (I installed FreeIPA replica)

#### Actual results
Crash:
$ dmesg -T
[Sat Mar 18 20:59:31 2017] traps: ns-slapd[3454] general protection ip:7f2fa2f08abd sp:7f2f787ef560 error:0 in libc-2.17.so[7f2fa2e8d000+1b7000]

#### Expected results
ns-slapd shouldn't crash, it should write errors to the log.


Fixed upstream

Comment 2 mreynolds 2017-03-21 20:14:29 UTC
Fixed upstream

Comment 3 Viktor Ashirov 2017-03-22 15:24:39 UTC
Mark, looks like it's a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1433697

Comment 4 mreynolds 2017-03-23 14:24:09 UTC

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