Bug 603886 - If empty totem tag is in config file ccs_config_dump segfaults
If empty totem tag is in config file ccs_config_dump segfaults
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: corosync (Show other bugs)
6.0
All Linux
low Severity medium
: rc
: ---
Assigned To: Steven Dake
Cluster QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-14 14:56 EDT by Chris Feist
Modified: 2016-04-26 11:38 EDT (History)
5 users (show)

See Also:
Fixed In Version: corosync-1.2.3-2.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-11-15 08:53: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)
Patch to fix objdb (400 bytes, patch)
2010-06-15 11:02 EDT, Christine Caulfield
no flags Details | Diff

  None (edit)
Description Chris Feist 2010-06-14 14:56:24 EDT
Description of problem:
If an empty totem tag is in the cluster.conf file ccs_config_dump segfaults causing 'service cman start' to fail.

Version-Release number of selected component (if applicable):
cman-3.0.12-6.el6.x86_64

How reproducible:
Everytime

Steps to Reproduce:
1. Put in empty totem tag into cluster.conf '<totem>'
2. Run 'service cman start'
3. Segfault
  
Actual results:
Segfault

Expected results:
Dump of cluster.conf file.

Additional info:
Stack trace of segfault:


Program terminated with signal 11, Segmentation fault.
#0  __strlen_sse2 () at ../sysdeps/x86_64/strlen.S:31
31		pcmpeqb	(%rdi), %xmm2
(gdb) bt
#0  __strlen_sse2 () at ../sysdeps/x86_64/strlen.S:31
#1  0x00007f6c54063898 in object_key_iter (parent_object_handle=1265737887312248845, key_name=0x7fff2b1ae398, key_len=0x7fff2b1ae390, 
    value=<value optimized out>, value_len=0x7fff2b1ae380) at objdb.c:1543
#2  0x00007f6c53c566b5 in copy_config_tree (objdb=0x7f6c54266380, source_object=1265737887312248845, target_parent_object=<value optimized out>, 
    always_create=<value optimized out>) at /usr/src/debug/cluster-3.0.12/cman/daemon/cman-preconfig.c:1066
#3  0x00007f6c53c567d1 in copy_tree_to_root (objdb=0x7f6c54266380, name=0x7f6c53c5a025 "totem", always_create=0)
    at /usr/src/debug/cluster-3.0.12/cman/daemon/cman-preconfig.c:1102
#4  0x00007f6c53c59a69 in cmanpre_readconfig (objdb=0x7f6c54266380, error_string=0x7fff2b1ae8f8)
    at /usr/src/debug/cluster-3.0.12/cman/daemon/cman-preconfig.c:1322
#5  0x00000039584087a8 in load_config () at sa-confdb.c:130
#6  confdb_sa_init () at sa-confdb.c:159
#7  0x0000003958402ee0 in confdb_initialize (handle=0x7fff2b1ae998, callbacks=0x6016a0) at confdb.c:146
#8  0x0000000000400f3f in main (argc=1, argv=0x7fff2b1aea98, envp=<value optimized out>)
    at /usr/src/debug/cluster-3.0.12/config/tools/xml/ccs_config_dump.c:138
Comment 1 RHEL Product and Program Management 2010-06-14 15:02:59 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.
Comment 2 Fabio Massimo Di Nitto 2010-06-15 01:21:05 EDT
Chrissie, looking at the back trace, this looks like a bug in cman-preconfig copy_to_tree function. From the look of it, it's a missing NULL check.

Can you please take a look at it?

Thanks
Fabio
Comment 3 Christine Caulfield 2010-06-15 04:05:25 EDT
Can you post the full cluster.conf file please? I can't reproduce this problem.

I tried

<?xml version="1.0" ?>
<cluster config_version="1" name="cluster3">

 <totem></totem>


... and

<?xml version="1.0" ?>
<cluster config_version="1" name="cluster3">

 <totem/>

...
Comment 4 Christine Caulfield 2010-06-15 11:02:27 EDT
Created attachment 424186 [details]
Patch to fix objdb

This looks to me like a bug in corosync.

object_key_iter() calls object_key_iter_typed() and then always tries to dereference the string it returns, even if it fails. The attached patch fixes this
Comment 6 releng-rhel@redhat.com 2010-11-15 08:53:45 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.