Bug 1243700 - GlusterD crashes when management encryption is enabled
Summary: GlusterD crashes when management encryption is enabled
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: rpc
Version: 3.6.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kaushal
QA Contact:
URL:
Whiteboard:
Depends On: 1241785 1242570 1243768
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-16 06:24 UTC by Kaushal
Modified: 2015-08-27 13:06 UTC (History)
3 users (show)

Fixed In Version: glusterfs-3.6.5
Doc Type: Bug Fix
Doc Text:
Clone Of: 1242570
Environment:
Last Closed: 2015-08-27 13:06:56 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Kaushal 2015-07-16 06:24:12 UTC
+++ This bug was initially created as a clone of Bug #1242570 +++

Two issues in socket_poller, the polling function used by SSL own-thread, caused GlusterD to crash when management encryption is enabled.

Issue 1
-------
socket_poller calls functions which require THIS to be set. But, THIS
was being set conditionally. Because of this, functions could sometimes
be called without THIS being set. For example, rpc_transport_notify
could be called for an accepted client socket without THIS being set, as
THIS was only set it the transport wasn't yet connected. This would
cause the process to crash when THIS was accessed by the called
functions.

Issue 2
-------
DISCONNECT notify was being sent on the listener transport instead of
the client transport. The DISCONNECT event was converted to a
LISTENER_DEAD event in rpcsvc_handle_disconnect, as it could not find
the listener socket of the listener socket. GlusterD was notified of a
LISTENER_DEAD event instead of a DISCONNECT and failed to remove the
client transport from its xprt_list. The transport would subsequently
be freed, leaving the xprt_list with a corrupted/invalid entry. Later,
when GlusterD would iterate over the xprt_list to send notifications, it
would crash when the invalid entry was accessed.

--- Additional comment from Anand Avati on 2015-07-13 21:04:25 IST ---

REVIEW: http://review.gluster.org/11650 (rpc-transport: socket_poller fixes for proper working of mgmt encryption) posted (#1) for review on master by Kaushal M (kaushal)

Comment 1 Anand Avati 2015-07-16 06:33:56 UTC
REVIEW: http://review.gluster.org/11690 (rpc-transport: socket_poller fixes for proper working of mgmt encryption) posted (#1) for review on release-3.6 by Kaushal M (kaushal)

Comment 2 Anand Avati 2015-07-17 07:19:06 UTC
COMMIT: http://review.gluster.org/11690 committed in release-3.6 by Raghavendra Bhat (raghavendra) 
------
commit 6263e73688ba2be49fd55f4c6a2d12609ce45f91
Author: Kaushal M <kaushal>
Date:   Mon Jul 13 16:16:00 2015 +0530

    rpc-transport: socket_poller fixes for proper working of mgmt encryption
    
      Backport of 8c39f14 from master
    
    socket_poller, the polling function used by ssl own_thread, had two
    issues which lead to GlusterD crashes when using management encryption
    
    Issue 1
    -------
    socket_poller calls functions which require THIS to be set. But, THIS
    was being set conditionally. Because of this, functions could sometimes
    be called without THIS being set. For example, rpc_transport_notify
    could be called for an accepted client socket without THIS being set, as
    THIS was only set it the transport wasn't yet connected. This would
    cause the process to crash when THIS was accessed by the called
    functions.
    
    To fix this, THIS is being set at the start of socket_poller
    unconditionally.
    
    Issue 2
    -------
    DISCONNECT notify was being sent on the listener transport instead of
    the client transport. The DISCONNECT event was converted to a
    LISTENER_DEAD event in rpcsvc_handle_disconnect, as it could not find
    the listener socket of the listener socket. GlusterD was notified of a
    LISTENER_DEAD event instead of a DISCONNECT and failed to remove the
    client transport from its xprt_list. The transport would subsequently
    be freed, leaving the xprt_list with a corrupted/invalid entry. Later,
    when GlusterD would iterate over the xprt_list to send notifications, it
    would crash when the invalid entry was accessed.
    
    To fix this, DISCONNECT notification in socket_poller is sent on the
    client socket, as it is done in the epoll handler.
    
    Change-Id: I0370b7c6d7eb13de10ebf08d91a4a39dc7d64c7a
    BUG: 1243700
    Signed-off-by: Kaushal M <kaushal>
    Reviewed-on: http://review.gluster.org/11690
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Raghavendra G <rgowdapp>
    Reviewed-by: Raghavendra Bhat <raghavendra>

Comment 3 Raghavendra Bhat 2015-08-27 13:06:56 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.6.5, please open a new bug report.

glusterfs-3.6.5 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://www.gluster.org/pipermail/gluster-devel/2015-August/046570.html
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user


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