Bug 1270427
Summary: | libvirt should escape possible invalid characters. | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Fangge Jin <fjin> |
Component: | libvirt | Assignee: | Martin Kletzander <mkletzan> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.2 | CC: | dyuan, fjin, mkletzan, mzhan, rbalakri |
Target Milestone: | rc | Keywords: | Upstream |
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-1.3.1-1.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-11-03 18:25:48 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: |
Description
Fangge Jin
2015-10-10 03:01:25 UTC
I would say, don't use HTML entities in name attributes, but ok, lets see... Did you use any fuzzy testing or did you try all possible attributes? Just to know if that problem is somewhere else as well. (In reply to Martin Kletzander from comment #2) > Did you use any fuzzy testing or did you try all possible attributes? Just > to know if that problem is somewhere else as well. I just did some random testing, I'm not sure if somewhere else has the same problem. FYI: Some other attributes with the problem have been fixed in the bug: Bug 1197580 - libvirt should escape possible invalid characters. Fixed upstream by v1.2.19-11-ge92e5ba12825 and v1.2.19-111-g363995b02982: commit 363995b02982771ad0e7a586520a232d1c383b91 Author: Luyao Huang <lhuang> Date: Tue Sep 22 16:13:53 2015 +0800 conf: escape string for disk driver name attribute commit e92e5ba12825b32ccc929a527077fb7019c87d1b Author: Pavel Hrdina <phrdina> Date: Mon Aug 31 15:33:49 2015 +0200 domain-conf: escape string for socket attribute Tested with build libvirt-1.3.2-1.el7.x86_64, it seems that it still doesn't work, guest xml validates failed. Steps: 1. Prepare a guest xml including special characters: # cat test.xml ... <disk type='file' device='disk'> <driver name='<>' type='qcow2' cache='none'/> ... 2. Try to define the guest with --validate # virsh define test.xml --validate error: Failed to define domain from test.xml error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng Extra element devices in interleave Element domain failed to validate content 3. Try to define the guest without --validate # virsh define test.xml Domain fedora23 defined from test.xml Check dumpxml: # virsh dumpxml fedora23 ... <disk type='file' device='disk'> <driver name='<>' type='qcow2' cache='none'/> ... Try to edit guest xml: # virsh edit fedora23 (change vcpu number from 4 to 1) error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng Extra element devices in interleave Element domain failed to validate content That's another type of problem, though. Separate BZ should be filed for that. The validation tells you that the XML will not probably work, so I think it's a good sign. Test pass with build libvirt-1.3.3-1.el7.x86_64 Steps: 1.# cat /tmp/windows.xml <disk type='file' device='disk'> <driver name='<>' type='qcow2'/> ... <graphics type='vnc' socket='<>'/> 2. # virsh define /tmp/windows.xml 3. # virsh dumpxml windows <disk type='file' device='disk'> <driver name='<>' type='qcow2'/> ... <graphics type='vnc' socket='<>'/> 4. # virsh define /tmp/windows.xml --validate error: Failed to define domain from /tmp/windows.xml error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng Extra element devices in interleave Element domain failed to validate content The validation fails because the value "<>" for driver name or socket path is invalid, it's reasonable. 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. https://rhn.redhat.com/errata/RHSA-2016-2577.html |