Bug 1982878 - Coverity Issues Found
Summary: Coverity Issues Found
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: vdo
Version: 8.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: beta
: ---
Assignee: sclafani
QA Contact: Filip Suba
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-15 21:38 UTC by Andy Walsh
Modified: 2021-11-10 06:40 UTC (History)
3 users (show)

Fixed In Version: 6.2.5.65
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-09 19:28:45 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:4359 0 None None None 2021-11-09 19:28:48 UTC

Description Andy Walsh 2021-07-15 21:38:55 UTC
Description of problem:
With the new build, two new coverity issues were discovered.

Error: CPPCHECK_WARNING (CWE-456):
vdo-e6ad32e1769484d59fc059163643a991da0799f9/utils/vdo/user/fileLayer.c:250: error[uninitvar]: Uninitialized variable: layer
#  248|     result = fileExists(layer->name, &exists);
#  249|     if (result != UDS_SUCCESS) {
#  250|->     FREE(layer);
#  251|       return result;
#  252|     }

Error: RESOURCE_LEAK (CWE-772):
vdo-e6ad32e1769484d59fc059163643a991da0799f9/utils/vdo/user/vdo2lvm.c:135: open_fn: Returning handle opened by "open". [Note: The source code implementation of the function has been overridden by a user model.]
vdo-e6ad32e1769484d59fc059163643a991da0799f9/utils/vdo/user/vdo2lvm.c:135: var_assign: Assigning: "fd" = handle returned from "open(fileName, 2178)".
vdo-e6ad32e1769484d59fc059163643a991da0799f9/utils/vdo/user/vdo2lvm.c:147: noescape: Resource "fd" is not freed or pointed-to in "fcntl".
vdo-e6ad32e1769484d59fc059163643a991da0799f9/utils/vdo/user/vdo2lvm.c:150: leaked_handle: Handle variable "fd" going out of scope leaks the handle.
#  148|     if (result != VDO_SUCCESS) {
#  149|       warnx("Unable to clear non-blocking flag for %s", fileName);
#  150|->     return result;
#  151|     }
#  152|   

Per Scliff: neither coverity item is of consequence. The first is a false positive that's trivial to silence, and the second is a genuine file descriptor leak (also trivial to fix) in the lvm conversion tool, which will exit shortly after leaking the descriptor, rendering it moot.

Version-Release number of selected component (if applicable):
vdo-6.2.5.62-14.el8

Actual results:
Coverity Warnings

Expected results:
No Coverity Warnings

Comment 4 Filip Suba 2021-08-16 08:00:37 UTC
Verified with vdo-6.2.5.65-14.el8.

Comment 7 errata-xmlrpc 2021-11-09 19:28:45 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 (kmod-kvdo bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4359


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