Bug 880064
| Summary: | [LXC] libvirt_lxc segfaults when staring lxc guest | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Alex Jia <ajia> | ||||
| Component: | libvirt | Assignee: | Peter Krempa <pkrempa> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | high | ||||||
| Version: | 6.4 | CC: | acathrow, dyasny, dyuan, mzhan, rwu, unicell, zhwang | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | libvirt-0.10.2-11.el6 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2013-02-21 07:27:45 UTC | Type: | Bug | ||||
| 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: | |||||||
| Bug Blocks: | 881827 | ||||||
| Attachments: | 
 | ||||||
| 
        
          Description
        
        
          Alex Jia
        
        
        
        
        
          2012-11-26 07:13:13 UTC
        
       Two patches fixing two possible segfaults were posted for upstream review: http://www.redhat.com/archives/libvir-list/2012-November/msg01097.html http://www.redhat.com/archives/libvir-list/2012-November/msg01087.html Fixed upstream:
commit 99a388e612d82a6bcd3462e4b98463fb32931520
Author: Peter Krempa <pkrempa>
Date:   Mon Nov 26 15:17:58 2012 +0100
    lxc: Don't crash if no security driver is specified in libvirt_lxc
    
    When no security driver is specified libvirt_lxc segfaults as a debug
    message tries to access security labels for the container that are not
    present.
    
    This problem was introduced in commit 6c3cf57d6cb27cf10064baf8cca0f39.
commit 81efb13b4a33f58c28e0e65dcc9521b983592683
Author: Peter Krempa <pkrempa>
Date:   Mon Nov 26 12:13:56 2012 +0100
    lxc: Avoid segfault of libvirt_lxc helper on early cleanup paths
    
    Early jumps to the cleanup label caused a crash of the libvirt_lxc
    container helper as the cleanup section called
    virLXCControllerDeleteInterfaces(ctrl) without checking the ctrl argument
    for NULL. The argument was de-referenced soon after.
    
    $ /usr/libexec/libvirt_lxc
    /usr/libexec/libvirt_lxc: missing --name argument for configuration
    Segmentation fault
Peter, unfortunately, your patches introduce new "Segmentation violation" question, for details, please see attachment. Alex Created attachment 652473 [details]
Segmentation violation
The issue is caused by a free of a uninitialized pointer. This issue was already fixed upstream by:
commit 3782814d4ad787d815e56382b6f809fe9020f14b
Author: Daniel P. Berrange <berrange>
Date:   Wed Nov 14 15:39:48 2012 +0000
    Fix uninitialized variable in virLXCControllerSetupDevPTS
    
    The lack of initialization of 'opts' caused a SEGV in the
    cleanup: path if the root->src directory did not exist
but was not backported.
Moving back to POST: http://post-office.corp.redhat.com/archives/rhvirt-patches/2012-November/msg00281.html
verified this bug in pkg
libvirt-0.10.2-11.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.340.el6.x86_64
kernel-2.6.32-343.el6.x86_64
steps
1. # cat instance-0000006f
<domain type='lxc'>
  <name>instance-00000069</name>
  <uuid>5abb4ca2-9e9b-4b33-b489-b09d301b1e8f</uuid>
  <memory unit='KiB'>524288</memory>
  <currentMemory unit='KiB'>524288</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <os>
    <type arch='x86_64'>exe</type>
    <init>/sbin/init</init>
    <cmdline>console=ttyS0</cmdline>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/libexec/libvirt_lxc</emulator>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/home/stack/nova_state/instances/instance-00000069/rootfs'/>
      <target dir='/'/>
    </filesystem>
    <interface type='bridge'>
      <mac address='fa:16:3e:24:b3:65'/>
      <source bridge='br100'/>
      <filterref filter='nova-instance-instance-00000069-fa163e24b365'>
        <parameter name='DHCPSERVER' value='10.48.253.1'/>
        <parameter name='IP' value='10.48.253.2'/>
        <parameter name='PROJMASK' value='255.255.255.0'/>
        <parameter name='PROJNET' value='10.48.253.0'/>
      </filterref>
    </interface>
    <console type='pty'>
      <target type='lxc' port='0'/>
    </console>
  </devices>
</domain>
2 excute the following command 
/usr/libexec/libvirt_lxc --name instance-0000006f --console 23 --handshake 26 --background --veth veth1  without any segfault 
3 valgrind -v --leak-check=full /usr/libexec/libvirt_lxc --name instance-0000006f --console 23 --handshake 26 --background --veth veth1  without  segfault info like this  
==17442== Process terminating with default action of signal 11 (SIGSEGV)
4 the lxc guest can start /destroy normally 
From above ,the problem  was solved correctly and I can also reproduce this bug in the pkg  libvirt-0.10.2-9.el6.x86_64, so this is fixed.
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/RHSA-2013-0276.html |