Bug 688087

Summary: Segfault on malformed network XML
Product: [Community] Virtualization Tools Reporter: Olof Johansson <olof>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: crobinso, xen-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-21 15:12:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Olof Johansson 2011-03-16 09:58:48 UTC
Description of problem:
Trying to use a malformed network XML will make libvirtd segfault. I accidently used a XML
with 

    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254' />
      <host mac='52:54:00:45:8c:a6' end='192.168.122.242' />
      <host mac='52:54:00:ce:52:50' end='192.168.122.92' />
    </dhcp>

and it made libvirtd segfault on startup:

Mar 16 10:14:27 yage kernel: [81842.933298] libvirtd[10857]: segfault at 0 ip 00007fed609e6670 sp 00007fff2d7bec98 error 4 in libc-2.11.2.so[7fed6090a000+158000]

I understand that this isn't proper usage, but I still don't think it should segfault. 

Version-Release number of selected component (if applicable):
I'm using the debian package libvirt-bin, version 0.8.3-5.

How reproducible:
Use an network XML with the dhcp-element shown above, and then try to start libvirtd.

Additional info:
gdb backtrace with partial symbol information:

#0  0x00007ffff546e670 in ?? () from /lib/libc.so.6
#1  0x00007ffff546e773 in inet_pton () from /lib/libc.so.6
#2  0x00007ffff78b2896 in ?? () from /usr/lib/libvirt.so.0
#3  0x00007ffff78b34cb in virNetworkDefParseNode () from /usr/lib/libvirt.so.0
#4  0x00007ffff78b3807 in ?? () from /usr/lib/libvirt.so.0
#5  0x000000000049b45a in ?? ()
#6  0x00007ffff78dbae0 in virStateInitialize () from /usr/lib/libvirt.so.0
#7  0x000000000041ec7c in ?? ()
#8  0x00007ffff53b0c4d in __libc_start_main () from /lib/libc.so.6
#9  0x0000000000417c89 in ?? ()
#10 0x00007fffffffecd8 in ?? ()
#11 0x000000000000001c in ?? ()
#12 0x0000000000000003 in ?? ()
#13 0x00007fffffffeecd in ?? ()
#14 0x00007fffffffeee0 in ?? ()
#15 0x00007fffffffeee9 in ?? ()
#16 0x0000000000000000 in ?? ()

(#3 was the only thing that made me think of networking.)

Comment 1 Olof Johansson 2011-03-16 10:01:02 UTC
Oops, sorry for the bad title :).

Comment 2 Cole Robinson 2011-03-21 15:12:29 UTC
This is already fixed upstream, duping to the original report. You probably want to file a bug with your distro though.

*** This bug has been marked as a duplicate of bug 653300 ***