Bug 825903 - Coverity scan relevant defects
Coverity scan relevant defects
Status: CLOSED UPSTREAM
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
x86_64 Linux
high Severity high
: rc
: ---
Assigned To: Alex Jia
Virtualization Bugs
:
: 771022 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-28 23:13 EDT by Alex Jia
Modified: 2012-10-09 22:42 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-10-09 22:42:30 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
CoverityScan on libvirt-0.9.10-21.el6.x86_64 (36.28 KB, text/plain)
2012-05-28 23:13 EDT, Alex Jia
no flags Details
CoverityScan on libvirt-0.10.0-0rc0.el6.src.rpm (24.91 KB, text/plain)
2012-08-06 01:15 EDT, Alex Jia
no flags Details

  None (edit)
Description Alex Jia 2012-05-28 23:13:50 EDT
Created attachment 587302 [details]
CoverityScan on libvirt-0.9.10-21.el6.x86_64

Description of problem:
The bug is used for tracking CoverityScan relevant issues for 6.4 like 6.3.

Version-Release number of selected component (if applicable):
# rpm -q libvirt
libvirt-0.9.10-21.el6.x86_64


How reproducible:
always

Steps to Reproduce:
1.
2.
3.
  
Actual results:
CoverityScan on libvirt-0.9.10-21.el6.x86_64:

Analysis summary report:
------------------------
Files analyzed                 : 249
Total LoC input to cov-analyze : 310106
Functions analyzed             : 7587
Paths analyzed                 : 868953
Defect occurrences found       : 43 Total
                                  6 CHECKED_RETURN
                                 13 DEADCODE
                                  1 EVALUATION_ORDER
                                  1 FORWARD_NULL
                                  1 MISSING_RETURN
                                  2 NEGATIVE_RETURNS
                                  1 NO_EFFECT
                                  3 NULL_RETURNS
                                  1 OVERRUN_STATIC
                                  7 RESOURCE_LEAK
                                  1 RETURN_LOCAL
                                  1 SIZEOF_MISMATCH
                                  3 UNINIT
                                  2 UNUSED_VALUE

Expected results:


Additional info:
Comment 2 Dave Allan 2012-05-29 12:00:28 EDT
Alex, would it be possible for you to file BZs for the specific problems reported by Coverity instead of a single BZ for the entire report?
Comment 3 Alex Jia 2012-05-29 22:21:07 EDT
(In reply to comment #2)
> Alex, would it be possible for you to file BZs for the specific problems
> reported by Coverity instead of a single BZ for the entire report?

Yeah, I'm analysing test report then will pick up some critical issues in here later.
Comment 4 Alex Jia 2012-05-30 06:40:34 EDT
Need to confirm the following issues:

1.
Error: OVERRUN_STATIC:
/builddir/build/BUILD/libvirt-0.9.10/src/locking/lock_driver_sanlock.c:158: overrun-buffer-arg: Overrunning static array ""__LIBVIRT__DISKS__"" of size 19 bytes by passing it to a function which indexes it with argument "48UL" at byte position 47.

2.
Error: SIZEOF_MISMATCH:
/builddir/build/BUILD/libvirt-0.9.10/tools/virsh.c:5316: suspicious_sizeof: Passing argument "8UL /* sizeof (cpumap) */" to function "_vshCalloc" and then casting the return value to "unsigned char *" is suspicious.

3.
Error: UNINIT:
/builddir/build/BUILD/libvirt-0.9.10/src/lxc/lxc_driver.c:1395: var_decl: Declaring variable "fd" without initializer.
/builddir/build/BUILD/libvirt-0.9.10/src/lxc/lxc_driver.c:1443: uninit_use_in_call: Using uninitialized value "fd" when calling "virFileClose".
/builddir/build/BUILD/libvirt-0.9.10/src/util/virfile.c:50: read_parm: Reading a parameter value.

4.
Error: UNINIT:
/builddir/build/BUILD/libvirt-0.9.10/src/lxc/lxc_controller.c:1104: var_decl: Declaring variable "consoles" without initializer.
/builddir/build/BUILD/libvirt-0.9.10/src/lxc/lxc_controller.c:1237: uninit_use: Using uninitialized value "consoles".

Notes, upstream commit f74471de has fixed issue 3 and 4.

For memory leaks and NULL pointer derefing, they should be okay for libvirt.

In addition, I want to open the bug until rhel6.4 release then trace all of Coverity issues into the bug.

Alex
Comment 6 RHEL Product and Program Management 2012-07-10 03:23:13 EDT
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
Comment 7 RHEL Product and Program Management 2012-07-10 19:51:35 EDT
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.
Comment 12 Alex Jia 2012-08-06 01:13:36 EDT
Coverity scan on libvirt-0.10.0-0rc0:

Analysis summary report:
------------------------
Files analyzed                 : 274
Total LoC input to cov-analyze : 320606
Functions analyzed             : 7882
Paths analyzed                 : 860037
Defect occurrences found       : 38 Total
                                  3 CHECKED_RETURN
                                  6 DEADCODE
                                  6 FORWARD_NULL
                                  2 MISSING_RETURN
                                  3 NEGATIVE_RETURNS
                                  3 NO_EFFECT
                                  1 NULL_RETURNS
                                  1 OVERRUN_STATIC
                                  5 RESOURCE_LEAK
                                  1 RETURN_LOCAL
                                  1 REVERSE_INULL
                                  1 SIZEOF_MISMATCH
                                  3 UNINIT
                                  2 UNUSED_VALUE

For details, please check attachment.
Comment 13 Alex Jia 2012-08-06 01:15:29 EDT
Created attachment 602408 [details]
CoverityScan on libvirt-0.10.0-0rc0.el6.src.rpm
Comment 14 Dave Allan 2012-08-06 11:01:13 EDT
*** Bug 771022 has been marked as a duplicate of this bug. ***
Comment 15 Dave Allan 2012-10-09 21:48:26 EDT
Alex, I'd like to close this BZ and open new BZs for any specific leaks that need to be fixed in 6.4.  Is that ok with you?
Comment 16 Alex Jia 2012-10-09 22:40:19 EDT
(In reply to comment #15)
> Alex, I'd like to close this BZ and open new BZs for any specific leaks that
> need to be fixed in 6.4.  Is that ok with you?

Dave, it's okay for me.
Comment 17 Dave Allan 2012-10-09 22:42:30 EDT
Ok, thanks.

Note You need to log in before you can comment on or make changes to this bug.