Bug 1310970 - Accessing program list in build_prog_details () should be lock protected
Summary: Accessing program list in build_prog_details () should be lock protected
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: rpc
Version: 3.7.8
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Atin Mukherjee
QA Contact:
URL:
Whiteboard:
Depends On: 1306560
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-23 04:40 UTC by Atin Mukherjee
Modified: 2016-09-01 09:32 UTC (History)
2 users (show)

Fixed In Version: glusterfs-3.7.15
Clone Of: 1306560
Environment:
Last Closed: 2016-09-01 09:20:35 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Atin Mukherjee 2016-02-23 04:40:22 UTC
+++ This bug was initially created as a clone of Bug #1306560 +++

Description of problem:

Currently build_prog_details() iterates over the rpcsvc's program list and constructs a local linked list. However the same happens with out any lock protection and hence this can cause a crash if some other writer threads modify the same list.

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

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Vijay Bellur on 2016-02-11 05:09:31 EST ---

REVIEW: http://review.gluster.org/13428 (rpc : build_prog_details should iterate program list inside critical section) posted (#1) for review on master by Atin Mukherjee (amukherj)

--- Additional comment from Vijay Bellur on 2016-02-11 06:45:55 EST ---

REVIEW: http://review.gluster.org/13428 (rpc : build_prog_details should iterate program list inside critical section) posted (#2) for review on master by Atin Mukherjee (amukherj)

--- Additional comment from Vijay Bellur on 2016-02-12 06:31:06 EST ---

REVIEW: http://review.gluster.org/13428 (rpc : build_prog_details should iterate program list inside critical section) posted (#3) for review on master by Atin Mukherjee (amukherj)

--- Additional comment from Vijay Bellur on 2016-02-22 05:49:33 EST ---

REVIEW: http://review.gluster.org/13428 (rpc : build_prog_details should iterate program list inside critical section) posted (#4) for review on master by Atin Mukherjee (amukherj)

--- Additional comment from Vijay Bellur on 2016-02-22 13:07:15 EST ---

COMMIT: http://review.gluster.org/13428 committed in master by Raghavendra G (rgowdapp) 
------
commit 663d1a5eed5a8aef6cfad4710e16d21740bf0da8
Author: Atin Mukherjee <amukherj>
Date:   Thu Feb 11 15:37:08 2016 +0530

    rpc : build_prog_details should iterate program list inside critical section
    
    While I was analyzing a glusterd crash from free_prog_details, a code
    walkthrough detects that we iterate over the rpc svc program list without been
    inside the criticial section. This opens up a possibility of a crash when there
    is a concurrent writer updating the same list. Solution is to read the list
    inside lock.
    
    Change-Id: Ib4b4b0022a9535e139cd3c00574aab23f07aa9d2
    BUG: 1306560
    Signed-off-by: Atin Mukherjee <amukherj>
    Reviewed-on: http://review.gluster.org/13428
    Smoke: Gluster Build System <jenkins.com>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    Reviewed-by: Niels de Vos <ndevos>
    CentOS-regression: Gluster Build System <jenkins.com>
    Reviewed-by: Raghavendra G <rgowdapp>

Comment 1 Vijay Bellur 2016-02-23 04:41:32 UTC
REVIEW: http://review.gluster.org/13488 (rpc : build_prog_details should iterate program list inside critical section) posted (#1) for review on release-3.7 by Atin Mukherjee (amukherj)

Comment 2 Vijay Bellur 2016-08-08 14:25:30 UTC
REVIEW: http://review.gluster.org/13488 (rpc : build_prog_details should iterate program list inside critical section) posted (#2) for review on release-3.7 by Oleksandr Natalenko (oleksandr)

Comment 3 Vijay Bellur 2016-08-16 06:27:26 UTC
COMMIT: http://review.gluster.org/13488 committed in release-3.7 by Kaushal M (kaushal) 
------
commit 42b5b9bc63891a3447db56224713c5b1028549c5
Author: Atin Mukherjee <amukherj>
Date:   Thu Feb 11 15:37:08 2016 +0530

    rpc : build_prog_details should iterate program list inside critical section
    
    Backport of http://review.gluster.org/13428
    
    While I was analyzing a glusterd crash from free_prog_details, a code
    walkthrough detects that we iterate over the rpc svc program list without been
    inside the criticial section. This opens up a possibility of a crash when there
    is a concurrent writer updating the same list. Solution is to read the list
    inside lock.
    
    > Reviewed-on: http://review.gluster.org/13428
    > Smoke: Gluster Build System <jenkins.com>
    > CentOS-regression: Gluster Build System <jenkins.com>
    > NetBSD-regression: NetBSD Build System <jenkins.org>
    > Reviewed-by: Niels de Vos <ndevos>
    > Reviewed-by: Raghavendra G <rgowdapp>
    
    BUG: 1310970
    Change-Id: Ib4b4b0022a9535e139cd3c00574aab23f07aa9d2
    Signed-off-by: Atin Mukherjee <amukherj>
    Signed-off-by: Oleksandr Natalenko <oleksandr>
    Reviewed-on: http://review.gluster.org/13488
    Smoke: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Kaushal M <kaushal>

Comment 4 Kaushal 2016-09-01 09:20:35 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.7.15, please open a new bug report.

glusterfs-3.7.15 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://www.gluster.org/pipermail/gluster-devel/2016-September/050714.html
[2] https://www.gluster.org/pipermail/gluster-users/

Comment 5 Kaushal 2016-09-01 09:32:51 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.7.15, please open a new bug report.

glusterfs-3.7.15 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://www.gluster.org/pipermail/gluster-devel/2016-September/050714.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.