Bug 1012196 - libvirtd crashed when edit "backend model='egd' type='unix'" to guest xml file
libvirtd crashed when edit "backend model='egd' type='unix'" to guest xml file
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.0
x86_64 Linux
high Severity high
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-25 21:52 EDT by EricLee
Modified: 2014-06-17 20:56 EDT (History)
8 users (show)

See Also:
Fixed In Version: libvirt-1.1.1-8.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 05:41:30 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description EricLee 2013-09-25 21:52:57 EDT
Created attachment 803188 [details]
back trace of libvirtd crashed.

Description
libvirtd crashed when edit "backend model='egd' type='unix'" to guest xml file

Version:
libvirt-1.1.1-6.el7.x86_64
qemu-kvm-1.5.3-3.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
# virsh edit guest
add following xml to guest:
"
    <rng model='virtio'>
      <rate bytes='1234' period='2000'/>
      <backend model='egd' type='unix'>
        <source mode='bind' service='1024'/>
        <source mode='connect' host='10.66.7.179' service='1024'/>
      </backend>
    </rng>
"
save then :
error: End of file while reading data: Input/output error
Failed. Try again? [y,n,f,?]:
error: One or more references were leaked after disconnect from the hypervisor
error: Failed to reconnect to the hypervisor

Actual results:
libvirtd crashed.

Expected results:
libvirtd not crash.
Comment 2 Peter Krempa 2013-09-26 03:29:10 EDT
Fix posted upstream
https://www.redhat.com/archives/libvir-list/2013-September/msg01551.html
Comment 3 Peter Krempa 2013-09-26 07:42:55 EDT
This issue is now fixed upstream:

commit 795527548fea79902ea4ce32747e069944cf3e61
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Thu Sep 26 08:12:39 2013 +0200

    conf: Don't crash on invalid chardev source definition of RNGs and other
    
    Since commit 297c99a5 an invalid source definition XML of a character
    device that is used as backend for RNG devices, smartcards and redirdevs
    causes crash of the daemon when parsing such a definition.
    
    The device types mentioned above are not a part of a regular character
    device but are backends for other types. Thus when parsing such device
    NULL is passed as the argument @chr_def. Later when checking the
    validity of the definition @chr_def was dereferenced when parsing a UNIX
    socket backend with missing path of the socket and crashed the daemon.
    
    Sample offending configuration:
      <devices>
      ...
        <rng model='virtio'>
          <backend model='egd' type='unix'>
            <source mode='bind' service='1024'/>
          </backend>
        </rng>
      </devices>
Comment 6 chhu 2013-10-09 02:37:57 EDT
Reproduced with libvirt-1.1.1-6.el7.x86_64,
Verified with package:
libvirt-1.1.1-8.el7.x86_64

Test steps:
1. # virsh edit guest
add following xml to guest:
    <rng model='virtio'>
      <rate bytes='1234' period='2000'/>
      <backend model='egd' type='unix'>
        <source mode='bind' service='1024'/>
        <source mode='connect' host='10.66.7.179' service='1024'/>
      </backend>
    </rng>

save then:
error: internal error: Missing source path attribute for char device
Failed. Try again? [y,n,f,?]:

2. #virsh edit guest
add following xml to guest:
        <rng model='virtio'>
          <backend model='egd' type='unix'>
            <source mode='bind' service='1024'/>
          </backend>
        </rng>

save then:
error: internal error: Missing source path attribute for char device
Failed. Try again? [y,n,f,?]:

Test results:
no libvirt crash, change the status to VERIFIED
Comment 7 Ludek Smid 2014-06-13 05:41:30 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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