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:
Covscan reports a possible NULL dereference in qcow2_check_refcounts.c:
qemu-kvm-0.12.1.2/block/qcow2-refcount.c:1390: returned_null: Function "g_realloc(gpointer, gsize)" returns null.
qemu-kvm-0.12.1.2/block/qcow2-refcount.c:1390: var_assigned: Assigning: "refcount_table" = null return value from "g_realloc(gpointer, gsize)".
qemu-kvm-0.12.1.2/block/qcow2-refcount.c:1395: dereference: Dereferencing a null pointer "refcount_table".
Here is the patch that introduced the problem:
commit 2f2ce9aa507d233f9a3c690e2cf815e7162de56c
Author: Max Reitz <mreitz>
Date: Fri May 2 16:58:43 2014 -0500
qcow2-refcount: Repair shared refcount blocks
Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.427.el6
How reproducible:
N/A
g_realloc() may only return NULL if the number of bytes requested is zero. nb_clusters is guaranteed to be non-zero, therefore g_realloc() should never return NULL here.
I'll add an assertion for refcount_table to be non-NULL, which will hopefully silence covscan.
Description of problem: Covscan reports a possible NULL dereference in qcow2_check_refcounts.c: qemu-kvm-0.12.1.2/block/qcow2-refcount.c:1390: returned_null: Function "g_realloc(gpointer, gsize)" returns null. qemu-kvm-0.12.1.2/block/qcow2-refcount.c:1390: var_assigned: Assigning: "refcount_table" = null return value from "g_realloc(gpointer, gsize)". qemu-kvm-0.12.1.2/block/qcow2-refcount.c:1395: dereference: Dereferencing a null pointer "refcount_table". Here is the patch that introduced the problem: commit 2f2ce9aa507d233f9a3c690e2cf815e7162de56c Author: Max Reitz <mreitz> Date: Fri May 2 16:58:43 2014 -0500 qcow2-refcount: Repair shared refcount blocks Version-Release number of selected component (if applicable): qemu-kvm-0.12.1.2-2.427.el6 How reproducible: N/A