Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 712115 - corosync confdb connection can cause segfault
corosync confdb connection can cause segfault
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: corosync (Show other bugs)
6.1
Unspecified Unspecified
high Severity high
: rc
: 6.2
Assigned To: Jan Friesse
Cluster QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-09 10:32 EDT by Jan Friesse
Modified: 2011-12-06 06:51 EST (History)
4 users (show)

See Also:
Fixed In Version: corosync-1.4.0-1.el6
Doc Type: Bug Fix
Doc Text:
Cause: A race condition in the internal confdb data storage system would had incorrect mutual exclusion. Consequence: Corosync would segfault under rare and contrived circumstances. Fix: The race condition was fixed. Result: Corosync no longer segfaults.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-12-06 06:51:01 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)
Patch for first problem (3.21 KB, patch)
2011-06-09 10:32 EDT, Jan Friesse
no flags Details | Diff
Patch for second problem (5.30 KB, patch)
2011-06-09 10:33 EDT, Jan Friesse
no flags Details | Diff
test-confdb patch which checks first problem in valgrind (2.16 KB, patch)
2011-06-09 10:35 EDT, Jan Friesse
no flags Details | Diff
First patch backprted to current RHEL 6 package (5.32 KB, patch)
2011-06-10 08:15 EDT, Jan Friesse
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1515 normal SHIPPED_LIVE corosync bug fix and enhancement update 2011-12-05 19:38:47 EST

  None (edit)
Description Jan Friesse 2011-06-09 10:32:59 EDT
Created attachment 503906 [details]
Patch for first problem

Description of problem:
Problem 1:
in confdb_object_iter result of object_find_create is now properly
checked. object_find_create can return -1 if object doesn't exists.
Without this check, incorrect handle (memory garbage) was directly
passed to object_find_next.

Problem 2:
Following situation could happen:
- process 1 thru confdb creates find handle
- calls find iteration once
- different process 2 deletes object pointed by process 1 iterator
- process 1 calls iteration again ->
  object_find_instance->find_child_list is invalid pointer

-> segfault

Now object_find_create creates array of matching object handlers and
object_find_next uses that array together with check for name. This
prevents situation where between steps 2 and 3 new object is created
with different name but sadly with same handler.

Version-Release number of selected component (if applicable):
Corosync master

How reproducible:
Often but it's race so depends on HW, ... Problem 1 is visible in valgrind.

Steps to Reproduce:
One node.
# for i in `seq 1 5`;do (while true;do corosync-objctl -a | grep closed;done)& done 
# corosync -f
  
Actual results:
segfault

Expected results:
no segfault

Additional info:
Comment 1 Jan Friesse 2011-06-09 10:33:43 EDT
Created attachment 503907 [details]
Patch for second problem
Comment 2 Jan Friesse 2011-06-09 10:35:39 EDT
Created attachment 503909 [details]
test-confdb patch which checks first problem in valgrind

Corosync must be running thru valgrind
Comment 3 Jan Friesse 2011-06-09 10:36:01 EDT
Patches posted to ML
Comment 5 Jan Friesse 2011-06-10 08:15:28 EDT
Created attachment 504088 [details]
First patch backprted to current RHEL 6 package
Comment 10 Steven Dake 2011-10-27 14:47:37 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: A race condition in the internal confdb data storage system would had incorrect mutual exclusion.
  Consequence: Corosync would segfault under rare and contrived circumstances.
  Fix: The race condition was fixed.
  Result: Corosync no longer segfaults.
Comment 11 errata-xmlrpc 2011-12-06 06:51:01 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1515.html

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