Bug 606335 - glibc detected *** corosync: malloc(): memory corruption
glibc detected *** corosync: malloc(): memory corruption
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: corosync (Show other bugs)
6.0
All Linux
urgent Severity urgent
: rc
: ---
Assigned To: Jan Friesse
Cluster QE
:
Depends On: 271561
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-21 08:50 EDT by Milos Malik
Modified: 2010-11-10 17:07 EST (History)
3 users (show)

See Also:
Fixed In Version: corosync-1.2.3-6.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-11-10 17:07:16 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)
Proposed patch (970 bytes, patch)
2010-06-22 05:13 EDT, Jan Friesse
no flags Details | Diff

  None (edit)
Description Milos Malik 2010-06-21 08:50:04 EDT
Description of problem:


Version-Release number of selected component (if applicable):
corosync-1.2.3-2.el6.i686
corosynclib-1.2.3-2.el6.i686

How reproducible:
always

Steps to Reproduce:
# mv /etc/corosync/corosync.conf.example /etc/corosync/corosync.conf
# service corosync status
corosync is stopped
# service corosync start
Starting Corosync Cluster Engine (corosync): *** glibc detected *** corosync: free(): invalid next size (fast): 0x09b34138 ***
*** glibc detected *** corosync: malloc(): memory corruption: 0x09b34148 ***

  
Actual results:


Expected results:
Comment 3 Steven Dake 2010-06-21 12:47:07 EDT
Did you set selinux to permissive before reproducing this bug?  There are currently issues with selinux and service corosync start.  Can you try corosync -f instead?
Comment 4 Nate Straz 2010-06-21 13:21:45 EDT
SELinux issues for the entire cluster stack are being handled in bug 271561.  There is currently one outstanding issue regarding the way corosync libraries create a communications socket with corosync.
Comment 5 Steven Dake 2010-06-21 15:27:49 EDT
The issue with corosync and selinux ATM is that service corosync start doesn't start creating all sorts of AVC denials.

Milos,

Can you verify you tried with permissive mode and received this error?
Comment 6 Milos Malik 2010-06-22 02:19:33 EDT
This bug seems to be reproducible in enforcing mode only:

# setenforce 0
# service corosync start
Starting Corosync Cluster Engine (corosync): [  OK  ]
# service corosync stop
Signaling Corosync Cluster Engine (corosync) to terminate: [  OK  ]
Waiting for corosync services to unload:.[  OK  ]
# setenforce 1
# service corosync start
Starting Corosync Cluster Engine (corosync): *** glibc detected *** corosync: free(): invalid next size (fast): 0x094dc260 ***
*** glibc detected *** corosync: malloc(): memory corruption: 0x094dc270 ***
Comment 7 Jan Friesse 2010-06-22 05:13:27 EDT
Created attachment 425871 [details]
Proposed patch

Main problem was hidden in calling pathconf (internally calls statfs) which fails. After this fail, newly allocated memory for readdir_r was smaller than expected and memory was overwritten by readdir_r.

Patch removes calling of pathconf and rather use NAME_MAX constant which is always large enough for all file systems.

Also return value of malloc SHOULD be checked.
Comment 8 Jan Friesse 2010-06-23 04:45:58 EDT
Patch committed revision 2962.
Comment 10 Nate Straz 2010-07-08 16:58:35 EDT
[root@morph-01 ~]# rpm -q corosync
corosync-1.2.3-9.el6.i686
[root@morph-01 ~]# setenforce 1
[root@morph-01 ~]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:          permissive
Policy version:                 24
Policy from config file:        targeted
[root@morph-01 ~]# service corosync start
Starting Corosync Cluster Engine (corosync): [  OK  ]
[root@morph-01 ~]# service corosync status
corosync (pid  1820) is running...
Comment 11 releng-rhel@redhat.com 2010-11-10 17:07:16 EST
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

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