RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1373535 - smbios serial parameter insufficiently escaped when passed from XML to qemu-kvm
Summary: smbios serial parameter insufficiently escaped when passed from XML to qemu-kvm
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: lijuan men
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-06 14:23 UTC by Barak Korren
Modified: 2017-08-02 01:27 UTC (History)
6 users (show)

Fixed In Version: libvirt-2.5.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 17:14:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:1846 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2017-08-01 18:02:50 UTC

Description Barak Korren 2016-09-06 14:23:51 UTC
Description of problem:
When XML like the following is passed to libvirt (note the comma):

   ...
   <sysinfo type="smbios">
       <system>
           ...
           <entry name="serial">foo,bar</entry>
           ...
       </system>
   </sysinfo>
   ...

When starting the VM, the following error message is yielded:

   libvirtError: internal error: process exited while connecting to monitor: 
   qemu-kvm: -smbios ... ,serial=label:foo,bar ... : Invalid parameter 'bar'

It seems that the comma causes 'bar' to be considered as an additional parameter rather then a part of the custom serial number. Potentially XML values could be crafted to perform unintended tweaks...

Comment 2 Peter Krempa 2016-10-14 02:05:53 UTC
Fixed upstream:

commit cf9a423cbd06440eb287f2faf2c267253db9e366
Author: Peter Krempa <pkrempa>
Date:   Mon Oct 10 17:49:03 2016 +0200

    schema: smbios: allow any strings
    
    The smbios docs allow any string to be passed and libvirt does not
    really do any validation on them. Allow passing any string.
    
    Partially resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1373535

commit fef3a810c7cc50bfc7ad274e5d658d96d2db6698
Author: Peter Krempa <pkrempa>
Date:   Mon Oct 10 06:26:50 2016 +0200

    qemu: command: escape smbios entry strings
    
    We pass free-form strings from the users to qemu, thus we need escape
    commas since they are passed to qemu monitor.
    
    Partially resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1373535

Comment 4 lijuan men 2017-02-17 03:39:38 UTC
verify the bug

version:
libvirt-3.0.0-1.el7.x86_64
qemu-kvm-rhev-2.8.0-3.el7.x86_64

steps:

1.start a guest with the following xml:
...
 <sysinfo type='smbios'>
    <bios>
      <entry name='vendor'>LEN OVO</entry>
      <entry name='version'>6F{ET8}_2BW (3.12 )</entry>
      <entry name='date'>02/08/2012</entry>
    </bios>
    <system>
      <entry name='manufacturer'>Fed,ora</entry>
      <entry name='product'>Virt/-"Manager"</entry>
      <entry name='version'>0.'8.2-3.fc14'</entry>
      <entry name='serial'>32d,fcb37-5af1[-55,2b-357c-be8c3aa38310]</entry>
      <entry name='uuid'>f38a1abd-3ff1-434e-ae79-75ba67df289b</entry>
      <entry name='sku'>12345#$*67.890</entry>
    </system>
  </sysinfo>
...

 <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.4.0'>hvm</type>
    <boot dev='hd'/>
   *** <smbios mode='sysinfo'/> ***
  </os>

...

2.in the guest,
[root@localhost ~]# dmidecode
...
BIOS Information
        Vendor: LEN OVO
        Version: 6F{ET8}_2BW (3.12 )
        Release Date: 02/08/2012
        Address: 0xE8000
        Runtime Size: 96 kB
        ROM Size: 64 kB
        Characteristics:
                BIOS characteristics not supported
                Targeted content distribution is supported
                System is a virtual machine
        BIOS Revision: 0.0

Handle 0x0100, DMI type 1, 27 bytes
System Information
        Manufacturer: Fed,ora
        Product Name: Virt/-"Manager"
        Version: 0.'8.2-3.fc14'
        Serial Number: 32d,fcb37-5af1[-55,2b-357c-be8c3aa38310]
        UUID: F38A1ABD-3FF1-434E-AE79-75BA67DF289B
        Wake-up Type: Power Switch
        SKU Number: 12345#$*67.890
        Family: Red Hat Enterprise Linux
...

It is same as in xml,so the bug is verified.

Comment 5 errata-xmlrpc 2017-08-01 17:14:13 UTC
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://access.redhat.com/errata/RHEA-2017:1846

Comment 6 errata-xmlrpc 2017-08-01 23:55:08 UTC
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://access.redhat.com/errata/RHEA-2017:1846

Comment 7 errata-xmlrpc 2017-08-02 01:27:35 UTC
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://access.redhat.com/errata/RHEA-2017:1846


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