mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-18 10:35:20 +00:00
udevProcessCSS: Check if def->driver is non-NULL
Don't process subchannel devices where `def->driver` is not set. This fixes the following segfault: Thread 21 "nodedev-init" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x3ffb08fc910 (LWP 64303)] (gdb) bt #0 0x000003fffd1272b4 in __strcmp_vx () at /lib64/libc.so.6 #1 0x000003ffc260c3a8 in udevProcessCSS (device=0x3ff9018d130, def=0x3ff90194a90) #2 0x000003ffc260cb78 in udevGetDeviceDetails (device=0x3ff9018d130, def=0x3ff90194a90) #3 0x000003ffc260d126 in udevAddOneDevice (device=0x3ff9018d130) #4 0x000003ffc260d414 in udevProcessDeviceListEntry (udev=0x3ffa810d800, list_entry=0x3ff90001990) #5 0x000003ffc260d638 in udevEnumerateDevices (udev=0x3ffa810d800) #6 0x000003ffc260e08e in nodeStateInitializeEnumerate (opaque=0x3ffa810d800) #7 0x000003fffdaa14b6 in virThreadHelper (data=0x3ffa810df00) #8 0x000003fffc309ed6 in start_thread () #9 0x000003fffd185e66 in thread_start () (gdb) p *def $2 = { name = 0x0, sysfs_path = 0x3ff90198e80 "/sys/devices/css0/0.0.ff40", parent = 0x0, parent_sysfs_path = 0x0, parent_wwnn = 0x0, parent_wwpn = 0x0, parent_fabric_wwn = 0x0, driver = 0x0, devnode = 0x0, devlinks = 0x3ff90194670, caps = 0x3ff90194380 } Fixes: 05e6cdafa6e0 ("node_device: detect CSS devices") Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Erik Skultety <eskultet@redhat.com> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
This commit is contained in:
parent
4277e61e22
commit
cb09344a2c
@ -1130,8 +1130,9 @@ udevProcessCSS(struct udev_device *device,
|
||||
virNodeDeviceDefPtr def)
|
||||
{
|
||||
/* only process IO subchannel and vfio-ccw devices to keep the list sane */
|
||||
if (STRNEQ(def->driver, "io_subchannel") &&
|
||||
STRNEQ(def->driver, "vfio_ccw"))
|
||||
if (!def->driver ||
|
||||
(STRNEQ(def->driver, "io_subchannel") &&
|
||||
STRNEQ(def->driver, "vfio_ccw")))
|
||||
return -1;
|
||||
|
||||
if (udevGetCCWAddress(def->sysfs_path, &def->caps->data) < 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user