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.

Bug 735660

Summary: Field access results in a dereference of a null pointer (loaded from variable 'l_disk')
Product: Red Hat Enterprise Linux 6 Reporter: Alex Jia <ajia>
Component: libvirtAssignee: Osier Yang <jyang>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: dallan, dyuan, rwu, veillard
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-08 06:38:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alex Jia 2011-09-04 16:56:14 UTC
Description of problem:
File:	src/libxl/libxl_driver.c
Location:	line 3017, column 17
Description:	Field access results in a dereference of a null pointer (loaded from variable 'l_disk')

2979	static int
2980	libxlDomainDetachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
2981	virDomainObjPtr vm, virDomainDeviceDefPtr dev)
2982	{
2983	virDomainDiskDefPtr l_disk = NULL;

Notes: Variable 'l_disk' initialized to a null pointer value.

2989	switch (dev->data.disk->device) {

Notes: Control jumps to 'case VIR_DOMAIN_DISK_DEVICE_DISK:' at line 2990
    
2990	case VIR_DOMAIN_DISK_DEVICE_DISK:
2991	if (dev->data.disk->bus == VIR_DOMAIN_DISK_BUS_XEN) {

Notes: Taking false branch

3016	} else {
3017	libxlError(VIR_ERR_CONFIG_UNSUPPORTED,
3018	_("disk bus '%s' cannot be hot unplugged."),
3019	virDomainDiskBusTypeToString(l_disk->bus));

Notes: 	Within the expansion of the macro 'libxlError':
        Field access results in a dereference of a null 
        pointer (loaded from variable 'l_disk')


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

How reproducible:
always

Steps to Reproduce:
1. directly analyze libvirt soure codes 
   or using static codes analysis tool such as clang. 
2. 
3.
  
Actual results:


Expected results:
Avoid a dereference of a null pointer.


Additional info:

Comment 1 Alex Jia 2011-09-04 16:59:13 UTC
Patch for upstream and wait for developers review:
http://www.redhat.com/archives/libvir-list/2011-September/msg00265.html

Alex