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.
Covscan reports that there is a missing return value check on the call to virtio_load in routine virtio_load_rng in hw/virtio_rng.c:
qemu-kvm-0.12.1.2/hw/virtio-rng.c:130: check_return: Calling function "virtio_load(VirtIODevice *, QEMUFile *)" without checking return value (as is done elsewhere 4 out of 5 times).
qemu-kvm-0.12.1.2/hw/virtio-balloon.c:271: example_assign: Example 1: Assigning: "ret" = return value from "virtio_load(&s->vdev, f)".
qemu-kvm-0.12.1.2/hw/virtio-balloon.c:272: example_checked: Example 1 (cont.): "ret" has its value checked in "ret".
qemu-kvm-0.12.1.2/hw/virtio-net.c:1002: example_assign: Example 2: Assigning: "ret" = return value from "virtio_load(&n->vdev, f)".
qemu-kvm-0.12.1.2/hw/virtio-net.c:1003: example_checked: Example 2 (cont.): "ret" has its value checked in "ret".
qemu-kvm-0.12.1.2/hw/virtio-scsi.c:594: example_assign: Example 3: Assigning: "ret" = return value from "virtio_load(&s->vdev, f)".
qemu-kvm-0.12.1.2/hw/virtio-scsi.c:595: example_checked: Example 3 (cont.): "ret" has its value checked in "ret".
qemu-kvm-0.12.1.2/hw/virtio-serial-bus.c:670: example_assign: Example 4: Assigning: "ret" = return value from "virtio_load(&s->vdev, f)".
qemu-kvm-0.12.1.2/hw/virtio-serial-bus.c:671: example_checked: Example 4 (cont.): "ret" has its value checked in "ret".
qemu-kvm-0.12.1.2/hw/virtio-rng.c:130: unchecked_value: No check of the return value of "virtio_load(&vrng->vdev, f)".
Here is the patch that introduced the problem:
commit 1ecb9c3580e9c6975a8f203555735499d7f8fc91
Author: Amos Kong <akong>
Date: Tue Sep 10 06:07:55 2013 +0200
virtio-rng: hardware random number generator device
Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.427.el6
How reproducible:
N/A
I will send a fix to upstream:
commit 689f2859c10671390e31a287b094a1bc02ffc015
Author: Amos Kong <akong>
Date: Mon Jul 7 22:55:56 2014 +0800
virtio-rng: check return value of virtio_load()
Signed-off-by: Amos Kong <akong>
diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c
index b6ab361..cc4b9e9 100644
--- a/hw/virtio/virtio-rng.c
+++ b/hw/virtio/virtio-rng.c
@@ -109,11 +109,16 @@ static int virtio_rng_load(QEMUFile *f, void *opaque, int version_id)
{
VirtIORNG *vrng = opaque;
VirtIODevice *vdev = VIRTIO_DEVICE(vrng);
+ int ret;
if (version_id != 1) {
return -EINVAL;
}
- virtio_load(vdev, f);
+
+ ret = virtio_load(vdev, f);
+ if (ret) {
+ return ret;
+ }
/* We may have an element ready but couldn't process it due to a quota
* limit. Make sure to try again after live migration when the quota may
I will send a fix to upstream:
commit 689f2859c10671390e31a287b094a1bc02ffc015
Author: Amos Kong <akong>
Date: Mon Jul 7 22:55:56 2014 +0800
virtio-rng: check return value of virtio_load()
Signed-off-by: Amos Kong <akong>
diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c
index b6ab361..cc4b9e9 100644
--- a/hw/virtio/virtio-rng.c
+++ b/hw/virtio/virtio-rng.c
@@ -109,11 +109,16 @@ static int virtio_rng_load(QEMUFile *f, void *opaque, int version_id)
{
VirtIORNG *vrng = opaque;
VirtIODevice *vdev = VIRTIO_DEVICE(vrng);
+ int ret;
if (version_id != 1) {
return -EINVAL;
}
- virtio_load(vdev, f);
+
+ ret = virtio_load(vdev, f);
+ if (ret) {
+ return ret;
+ }
/* We may have an element ready but couldn't process it due to a quota
* limit. Make sure to try again after live migration when the quota may
Comment 6Miroslav Rezanina
2014-07-23 10:34:50 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.
http://rhn.redhat.com/errata/RHBA-2014-1490.html
Covscan reports that there is a missing return value check on the call to virtio_load in routine virtio_load_rng in hw/virtio_rng.c: qemu-kvm-0.12.1.2/hw/virtio-rng.c:130: check_return: Calling function "virtio_load(VirtIODevice *, QEMUFile *)" without checking return value (as is done elsewhere 4 out of 5 times). qemu-kvm-0.12.1.2/hw/virtio-balloon.c:271: example_assign: Example 1: Assigning: "ret" = return value from "virtio_load(&s->vdev, f)". qemu-kvm-0.12.1.2/hw/virtio-balloon.c:272: example_checked: Example 1 (cont.): "ret" has its value checked in "ret". qemu-kvm-0.12.1.2/hw/virtio-net.c:1002: example_assign: Example 2: Assigning: "ret" = return value from "virtio_load(&n->vdev, f)". qemu-kvm-0.12.1.2/hw/virtio-net.c:1003: example_checked: Example 2 (cont.): "ret" has its value checked in "ret". qemu-kvm-0.12.1.2/hw/virtio-scsi.c:594: example_assign: Example 3: Assigning: "ret" = return value from "virtio_load(&s->vdev, f)". qemu-kvm-0.12.1.2/hw/virtio-scsi.c:595: example_checked: Example 3 (cont.): "ret" has its value checked in "ret". qemu-kvm-0.12.1.2/hw/virtio-serial-bus.c:670: example_assign: Example 4: Assigning: "ret" = return value from "virtio_load(&s->vdev, f)". qemu-kvm-0.12.1.2/hw/virtio-serial-bus.c:671: example_checked: Example 4 (cont.): "ret" has its value checked in "ret". qemu-kvm-0.12.1.2/hw/virtio-rng.c:130: unchecked_value: No check of the return value of "virtio_load(&vrng->vdev, f)". Here is the patch that introduced the problem: commit 1ecb9c3580e9c6975a8f203555735499d7f8fc91 Author: Amos Kong <akong> Date: Tue Sep 10 06:07:55 2013 +0200 virtio-rng: hardware random number generator device Version-Release number of selected component (if applicable): qemu-kvm-0.12.1.2-2.427.el6 How reproducible: N/A