Bug 1405886 - Fix potential leaks in INODELK cbk in protocol/client
Summary: Fix potential leaks in INODELK cbk in protocol/client
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: core
Version: 3.8
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Krutika Dhananjay
QA Contact:
URL:
Whiteboard:
Depends On: 1405885
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-19 04:21 UTC by Krutika Dhananjay
Modified: 2017-01-16 12:27 UTC (History)
1 user (show)

Fixed In Version: glusterfs-3.8.8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1405885
Environment:
Last Closed: 2017-01-16 12:27:19 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Krutika Dhananjay 2016-12-19 04:21:51 UTC
+++ This bug was initially created as a clone of Bug #1405885 +++

Description of problem:

There is a potential leak in protocol/client's INODELK callback:

<code>
 31
 30         GF_PROTOCOL_DICT_UNSERIALIZE (this, xdata, (rsp.xdata.xdata_val),
 29                                       (rsp.xdata.xdata_len), ret,
 28                                       rsp.op_errno, out);
 27
 26         ret = client_post_inodelk (this, &rsp, &xdata);
 25         if (ret < 0)
 24                 goto out;
 23 out:
</code>

The dict xdata is unserialized twice - once at line 30 and once inside client_post_inodelk function called at line 26. This is a memory leak. We're safe as of today because none of the xlators on the client stack that invoke inodelk fop (like AFR, DHT etc) pass xdata while winding it.



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Worker Ant on 2016-12-18 23:16:03 EST ---

REVIEW: http://review.gluster.org/16186 (protocol/client: Fix potential mem-leaks) posted (#1) for review on release-3.9 by Krutika Dhananjay (kdhananj)

Comment 1 Worker Ant 2016-12-19 04:23:10 UTC
REVIEW: http://review.gluster.org/16187 (protocol/client: Fix potential mem-leaks) posted (#1) for review on release-3.8 by Krutika Dhananjay (kdhananj)

Comment 2 Worker Ant 2016-12-21 06:54:39 UTC
COMMIT: http://review.gluster.org/16187 committed in release-3.8 by Raghavendra G (rgowdapp) 
------
commit e470c060351c5c1b477b82bbe18c5adc00241384
Author: Krutika Dhananjay <kdhananj>
Date:   Fri Dec 16 09:31:41 2016 +0530

    protocol/client: Fix potential mem-leaks
    
            Backport of: http://review.gluster.org/16156
    
    Commit 93eaeb9c93be3232f24e840044d560f9f0e66f71 introduces
    leaks in INODELK callback where a dict is unserialized twice,
    leading to dict leaks.
    
    Change-Id: I2ad6f4243d78ba30841731d331f5a4a0006827da
    BUG: 1405886
    Signed-off-by: Krutika Dhananjay <kdhananj>
    Reviewed-on: http://review.gluster.org/16187
    Smoke: Gluster Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    Reviewed-by: Raghavendra G <rgowdapp>

Comment 3 Worker Ant 2016-12-21 23:22:34 UTC
REVIEW: http://review.gluster.org/16266 (protocol/client: Fix potential mem-leaks) posted (#1) for review on release-3.8-fb by Kevin Vigor (kvigor)

Comment 4 Niels de Vos 2017-01-16 12:27:19 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.8.8, please open a new bug report.

glusterfs-3.8.8 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] https://lists.gluster.org/pipermail/announce/2017-January/000064.html
[2] https://www.gluster.org/pipermail/gluster-users/


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