Bug 1766993

Summary: fence_virtd: fix segfault in vl_get when no domains are found
Product: Red Hat Enterprise Linux 8 Reporter: Oyvind Albrigtsen <oalbrigt>
Component: fence-virtAssignee: Oyvind Albrigtsen <oalbrigt>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.1CC: cluster-maint, mjuricek, rmccabe
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: fence-virt-0.4.0-9.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1766995 (view as bug list) Environment:
Last Closed: 2020-04-28 15:56:26 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:
Bug Depends On:    
Bug Blocks: 1766995    

Description Oyvind Albrigtsen 2019-10-30 12:43:58 UTC
Description of problem:
If virConnectListAllDomains() returns 0 on every iteration, the loop
will end with a vl == NULL and the pointer dereference in the qsort()
call will result in a segfault, so we need to check for NULL on completion of the loop to guard against that.

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. Start fence_virtd with no domains present
2.
3.

Actual results:
Segfaults.

Expected results:
Doesnt segfault.

Additional info:

Comment 1 Oyvind Albrigtsen 2019-10-30 12:46:09 UTC
https://github.com/ClusterLabs/fence-virt/pull/17

Comment 3 Oyvind Albrigtsen 2020-01-30 09:26:43 UTC
Additional patch to solve when it doesnt stop until systemd timeout's and kills it (found by QE):
https://github.com/ClusterLabs/fence-virt/commit/958c0035aa6a69149c1a0fa218863c26e755d9e6#diff-136aa843c9c2f4617a44f9978e771f3a

Comment 6 errata-xmlrpc 2020-04-28 15:56:26 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/RHBA-2020:1668