Bug 1153626

Summary: Sizeof bug for allocation of memory in afr_lookup
Product: [Community] GlusterFS Reporter: Pranith Kumar K <pkarampu>
Component: replicateAssignee: Pranith Kumar K <pkarampu>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.5.3CC: bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.5.3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-21 16:03:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pranith Kumar K 2014-10-16 11:03:49 UTC
Description of problem:
THe following bug is identified in coverity scan

6. Defect type: SIZEOF_MISMATCH
1. glusterfs-3.6.0.29/xlators/cluster/afr/src/afr-common.c:2576: suspicious_sizeof: Passing argument "112UL /* sizeof (*local->cont.lookup.xattr) */" to function "__gf_calloc(size_t, size_t, uint32_t, char const *)" and then casting the return value to "dict_t **" is suspicious.


Fortunately this doesn't lead to any problems because sizeof gives bigger number than 8.
Version-Release number of selected component (if applicable):


How reproducible:
Always when static analyser is run,
Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Anand Avati 2014-10-16 11:06:34 UTC
REVIEW: http://review.gluster.org/8935 (cluster/afr: Fix sizeof typo) posted (#1) for review on release-3.5 by Pranith Kumar Karampuri (pkarampu)

Comment 2 Anand Avati 2014-10-18 08:40:36 UTC
COMMIT: http://review.gluster.org/8935 committed in release-3.5 by Niels de Vos (ndevos) 
------
commit 30fab9575521fecc6498b67e5ec60b5150338aea
Author: Pranith Kumar K <pkarampu>
Date:   Thu Oct 16 15:44:02 2014 +0530

    cluster/afr: Fix sizeof typo
    
    Change-Id: Ib82a1c4967f0880c91c114e4baae08bdbe77bb60
    BUG: 1153626
    Signed-off-by: Pranith Kumar K <pkarampu>
    Reviewed-on: http://review.gluster.org/8935
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Niels de Vos <ndevos>

Comment 3 Niels de Vos 2014-11-05 09:25:07 UTC
The second Beta for GlusterFS 3.5.3 has been released [1]. Please verify if the release solves this bug report for you. In case the glusterfs-3.5.3beta2 release does not have a resolution for this issue, leave a comment in this bug and move the status to ASSIGNED. If this release fixes the problem for you, leave a note and change the status to VERIFIED.

Packages for several distributions have been made available on [2] to make testing easier.

[1] http://supercolony.gluster.org/pipermail/gluster-users/2014-November/019359.html
[2] http://download.gluster.org/pub/gluster/glusterfs/qa-releases/3.5.3beta2/

Comment 4 Niels de Vos 2014-11-21 16:03:12 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.5.3, please reopen this bug report.

glusterfs-3.5.3 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://supercolony.gluster.org/pipermail/announce/2014-November/000042.html
[2] http://supercolony.gluster.org/pipermail/gluster-users/