Bug 1597550
Summary: | libvirtd crashed when hot plug a scsi hostdev | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | yisun |
Component: | libvirt | Assignee: | Peter Krempa <pkrempa> |
Status: | CLOSED ERRATA | QA Contact: | yisun |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 7.6 | CC: | pkrempa, yisun |
Target Milestone: | rc | Keywords: | Automation, Regression |
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-4.5.0-2.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-10-30 09:56:58 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
yisun
2018-07-03 08:20:34 UTC
srcPriv is not allocated when no authentication is present seems srcPriv->secinfo is NULL when we didn't provide <auth> part in hostdev xml, with following xml, no crash happens: <hostdev mode="subsystem" type="scsi"><source name="iqn.2018-06.com.virttest:img0.target/0" protocol="iscsi"><host name="127.0.0.1" port="3260" /><auth username='myuser'><secret type='iscsi' usage='libvirtiscsi'/></auth></source></hostdev> And this is not reproduced with hostdev xml pointing to a local scsi device as follow: <hostdev mode="subsystem" rawio="yes" type="scsi"><source><adapter name="scsi_host31" /><address bus="0" target="0" unit="0" /></source></hostdev> Fixed upstream by: commit 33a475056fdd76c030528982e422bae79c0a0e4a Author: Peter Krempa <pkrempa> Date: Tue Jul 3 10:45:34 2018 +0200 qemu: hotplug: Don't access srcPriv when it's not allocated The private data of a virStorageSource which is backing an iSCSI hostdev may be NULL if no authentication is present. The code handling the hotplug would attempt to extract the authentication info stored in 'secinfo' without checking if it is allocated which resulted in a crash. Here we opt the easy way to check if srcPriv is not NULL so that we don't duplicate all the logic which selects whether the disk source has a secret. Verified with:libvirt-4.5.0-6.el7.x86_64 Steps: 1. # cat hostdev.iscsi <hostdev mode="subsystem" type="scsi"> <source name="iqn.2016-03.com.virttest:logical-pool.target/0" protocol="iscsi"> <host name="10.73.73.57" port="3260" /> </source> </hostdev> 2. # virsh list Id Name State ---------------------------------------------------- 10 vm1 running 3. # virsh attach-device vm1 hostdev.iscsi Device attached successfully 4. login vm and check new block device added. 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/RHSA-2018:3113 |