Bug 728908 - resource-agents: Coverity defects
Summary: resource-agents: Coverity defects
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: resource-agents
Version: 6.2
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Jan Pokorný [poki]
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 756082
TreeView+ depends on / blocked
 
Reported: 2011-08-08 11:09 UTC by Pavel Raiskup
Modified: 2015-10-16 19:18 UTC (History)
10 users (show)

Fixed In Version: resource-agents-3.9.2-30.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-16 19:13:39 UTC
Target Upstream Version:


Attachments (Terms of Use)
fix for "1" (1.32 KB, patch)
2011-08-08 11:09 UTC, Pavel Raiskup
no flags Details | Diff
fix for "2" (780 bytes, patch)
2011-08-08 11:10 UTC, Pavel Raiskup
no flags Details | Diff
fix for "3" (839 bytes, application/octet-stream)
2011-08-08 11:11 UTC, Pavel Raiskup
no flags Details
fix for "4" (868 bytes, patch)
2011-08-08 11:12 UTC, Pavel Raiskup
no flags Details | Diff
fix for "5" (678 bytes, patch)
2011-08-08 11:13 UTC, Pavel Raiskup
no flags Details | Diff
fix for "6" (1.05 KB, patch)
2011-08-08 11:13 UTC, Pavel Raiskup
no flags Details | Diff
fix for "3" repaired (959 bytes, patch)
2011-08-08 11:32 UTC, Pavel Raiskup
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 989284 None None None Never
Red Hat Bugzilla 993431 None None None Never

Internal Links: 989284 993431

Description Pavel Raiskup 2011-08-08 11:09:39 UTC
Created attachment 517169 [details]
fix for "1"

These errors was revealed by coverity difference scan on packages from rhel6.1/rhel6.2 

ERROR LIST:

1) tools/findif.c:547: Missing check for return value of inet_pton call in
ConvertQuadToint function.

2) tools/sfex_init.c: Missing check for write_lockdata return value.

3) heartbeat/IPv6addr.c:434: bad check for socket(3) return value .. returns -1 when error occurred

4) heartbeat/IPv6addr.c:706: missing check for socket(3) return value 

5) heartbeat/IPv6addr.c:704: msg.msg_flags is not initialized before recvmsg

6) tools/findif.c:{279|271}: unused value "cp"

7) tools/send_arp.linux.c:360: Missing break?

It would be nice if somebody could look at these defects.

Pavel

Comment 1 Pavel Raiskup 2011-08-08 11:10:59 UTC
Created attachment 517170 [details]
fix for "2"

Comment 2 Pavel Raiskup 2011-08-08 11:11:59 UTC
Created attachment 517172 [details]
fix for "3"

Comment 3 Pavel Raiskup 2011-08-08 11:12:26 UTC
Created attachment 517173 [details]
fix for "4"

Comment 4 Pavel Raiskup 2011-08-08 11:13:00 UTC
Created attachment 517175 [details]
fix for "5"

Comment 5 Pavel Raiskup 2011-08-08 11:13:55 UTC
Created attachment 517176 [details]
fix for "6"

Comment 6 Pavel Raiskup 2011-08-08 11:32:12 UTC
Created attachment 517179 [details]
fix for "3" repaired

Comment 13 RHEL Product and Program Management 2012-07-10 08:45:34 UTC
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 14 RHEL Product and Program Management 2012-07-11 01:48:46 UTC
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 15 Jan Pokorný [poki] 2012-10-04 11:24:43 UTC
First one, probably least straightforward, addressed by pull request [1].

[1] https://github.com/ClusterLabs/resource-agents/pull/143

Comment 16 Jan Pokorný [poki] 2012-10-04 15:19:07 UTC
I think 5) can be safely dropped as msg_flags item of struct msghdr:
- is supposed to be set in recvmsg (RECVMSG(2) is clear,
  RECVMSG(3p) seems to allow for both interpretation)
- is not examined upon return from recvmsg

Comment 17 Jan Pokorný [poki] 2012-10-04 16:17:33 UTC
So, currently the separation into pull requests is as follows:

1, 6: [1]
3, 4: [2]
2, 7: [3] (break was not missing, added clarification)
5:    omitted completely (see [comment 16])

[2] https://github.com/ClusterLabs/resource-agents/pull/144
[3] https://github.com/ClusterLabs/resource-agents/pull/145

Waiting for upstream's feedback.

Comment 18 Jan Pokorný [poki] 2012-10-05 13:36:11 UTC
The only more significant change worth some kind of validation
is related to findif helper.  Its test has been added to pull
request [1].

Comment 19 Fabio Massimo Di Nitto 2012-10-09 14:29:57 UTC
moving to 6.5. not relevant for 6.4 as only packemaker agents are affected and they are TP in RHEL6.x.

Comment 24 Jan Pokorný [poki] 2014-06-23 19:55:24 UTC
Need to check if those upstream fixes were downstreamed with [bug 993431]
rebase or not.

Comment 28 Fabio Massimo Di Nitto 2015-09-10 05:33:52 UTC
Jan,

have those fixes been included upstream?

Comment 29 Jan Pokorný [poki] 2015-10-16 19:10:55 UTC
> have those fixes been included upstream?

Investigating the state of the mentioned 3 PRs, they were merged
and initially included in the release 3.9.4.  PR#143 even made it
to the changelog:
[1] https://github.com/ClusterLabs/resource-agents/blob/v3.9.4/ChangeLog#L52


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