Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
Most libvirt APIs do argument validation, and properly report an error if a NULL object was passed in. However, virDomainMemoryStats causes a segfault.
Version-Release number of selected component (if applicable):
libvirt-0.8.7-5.el6
How reproducible:
100%
Steps to Reproduce:
1. $ cat foo.c
#include <libvirt.h>
#include <stdlib.h>
int main ()
{
if (virNWFilterGetXMLDesc(NULL, 1))
return 1;
if (virDomainMemoryStats(NULL, NULL, 0, 1) == -1)
return 0;
return 2;
}
2. $ gcc -I/usr/include/libvirt -o foo -Wall foo.c -lvirt
3. $ ./foo; echo $?
Actual results:
libvir: error : Unknown failure
Segmentation fault (core dumped)
139
Expected results:
libvir: error : Unknown failure
libvir: error : Unknown failure
0
Additional info:
The first call to virNWFilterGetXMLDesc is a sample API that proves that libvirt does argument validation and properly recognizes a NULL pointer. The second call to virDomainMemoryStats should do likewise, but it mistakenly reports an error about invalid flags before validating the domain pointer, and ends up dereferencing NULL.
Fixed by this upstream patch:
https://www.redhat.com/archives/libvir-list/2011-February/msg00479.html
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.
http://rhn.redhat.com/errata/RHBA-2011-0596.html
Description of problem: Most libvirt APIs do argument validation, and properly report an error if a NULL object was passed in. However, virDomainMemoryStats causes a segfault. Version-Release number of selected component (if applicable): libvirt-0.8.7-5.el6 How reproducible: 100% Steps to Reproduce: 1. $ cat foo.c #include <libvirt.h> #include <stdlib.h> int main () { if (virNWFilterGetXMLDesc(NULL, 1)) return 1; if (virDomainMemoryStats(NULL, NULL, 0, 1) == -1) return 0; return 2; } 2. $ gcc -I/usr/include/libvirt -o foo -Wall foo.c -lvirt 3. $ ./foo; echo $? Actual results: libvir: error : Unknown failure Segmentation fault (core dumped) 139 Expected results: libvir: error : Unknown failure libvir: error : Unknown failure 0 Additional info: The first call to virNWFilterGetXMLDesc is a sample API that proves that libvirt does argument validation and properly recognizes a NULL pointer. The second call to virDomainMemoryStats should do likewise, but it mistakenly reports an error about invalid flags before validating the domain pointer, and ends up dereferencing NULL. Fixed by this upstream patch: https://www.redhat.com/archives/libvir-list/2011-February/msg00479.html