Bug 728908

Summary: resource-agents: Coverity defects
Product: Red Hat Enterprise Linux 6 Reporter: Pavel Raiskup <praiskup>
Component: resource-agentsAssignee: Jan Pokorný [poki] <jpokorny>
Status: CLOSED CURRENTRELEASE QA Contact: cluster-qe <cluster-qe>
Severity: low Docs Contact:
Priority: low    
Version: 6.2CC: agk, cfeist, cluster-maint, fdinitto, jpokorny, kdudka, lhh, mgrac, mnovacek, oalbrigt
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: resource-agents-3.9.2-30.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-16 19:13:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 756082    
Attachments:
Description Flags
fix for "1"
none
fix for "2"
none
fix for "3"
none
fix for "4"
none
fix for "5"
none
fix for "6"
none
fix for "3" repaired none

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 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 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