Bug 1468422 - Libvirt crashed with SIGSEGV when creating a luks encrypted volume via an xml file without 'secret' element
Libvirt crashed with SIGSEGV when creating a luks encrypted volume via an xml...
Status: ASSIGNED
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.4
x86_64 Linux
unspecified Severity unspecified
: rc
: ---
Assigned To: Erik Skultety
yisun
:
Depends On:
Blocks: 1473046
  Show dependency treegraph
 
Reported: 2017-07-06 23:33 EDT by jiyan
Modified: 2018-01-03 00:19 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
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 jiyan 2017-07-06 23:33:20 EDT
Description of problem:
Libvirt crashed with SIGSEGV when creating a luks encrypted volume via an xml file without 'secret' element

Version-Release number of selected component (if applicable):
libvirt-3.2.0-14.el7.x86_64
qemu-kvm-rhev-2.9.0-14.el7.x86_64
kernel-3.10.0-689.el7.x86_64

How reproducible:
100%

Steps to reproduce:
1.Prepare a pool
# cat dirpool.xml 
<pool type="dir">
  <name>dirpool</name>
  <target>
    <path>/home/dirpool</path>
  </target>
</pool>

# virsh pool-define dirpool.xml 
Pool dirpool defined from dirpool.xml

# virsh pool-start dirpool
Pool dirpool started

2.Create luks encrypted vol via a xml file without  secret element
# cat dirvol.xml 
<volume>
	<name>dirvol</name>
	<capacity unit='G'>1</capacity>
	<target>
		<path>/home/dirpool/luks.img</path>
		<format type='raw'/>
		<encryption format='luks'>
			<cipher name='aes' size='256' mode='cbc' hash='sha256'/>
			<ivgen name='plain64' hash='sha256'/>
		</encryption>
	</target>
</volume>

# virsh vol-create dirpool dirvol.xml 
error: Disconnected from qemu:///system due to I/O error
error: Failed to create vol from dirvol.xml
error: End of file while reading data: Input/output error

Actual results:
# abrt-cli ls
id 120af61f2b6fc9ac6e1c08c2120e5f48a72b69ea
reason:         libvirtd killed by SIGSEGV
time:           Thu 06 Jul 2017 10:59:37 PM EDT
cmdline:        /usr/sbin/libvirtd
package:        libvirt-daemon-3.2.0-14.el7
uid:            0 (root)
Directory:      /var/spool/abrt/ccpp-2017-07-06-22:59:37-17335
Run 'abrt-cli report /var/spool/abrt/ccpp-2017-07-06-22:59:37-17335' for creating a case in Red Hat Customer Portal

Expected results:
1.libvirtd runs normally

2.As it is described in libvirt.org, there should be an error info such as: A single <secret type='passphrase'...> element is expected. not 'I/O error'.
http://libvirt.org/formatstorageencryption.html#StorageEncryptionLuks
The luks format is specific to a luks encrypted volume and the secret is used in order to either encrypt during volume creation or decrypt the volume for usage by the domain. A single <secret type='passphrase'...> element is expected. Since 2.1.0.


Additional info:
Program terminated with signal 11, Segmentation fault.
#0  0x00007f244b78dcb6 in storageBackendCreateQemuImgSecretPath (vol=0x7f2464002e00, pool=0x7f24140f5d00, conn=0x7f2468000b10) at storage/storage_util.c:1321
1321	    if (virSecretGetSecretString(conn, &enc->secrets[0]->seclookupdef,

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