Bug 1164775 - Glusterd segfaults on gluster volume status ... detail
Summary: Glusterd segfaults on gluster volume status ... detail
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: glusterd
Version: mainline
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-17 12:48 UTC by Petr Medonos
Modified: 2015-05-14 17:44 UTC (History)
4 users (show)

Fixed In Version: glusterfs-3.7.0
Doc Type: Bug Fix
Doc Text:
Clone Of: 1163920
Environment:
Last Closed: 2015-05-14 17:28:29 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Petr Medonos 2014-11-17 12:48:39 UTC
+++ This bug was initially created as a clone of Bug #1163920 +++

Description of problem:
Issuing ‘gluster volume status … detail’ command segfaults the glusterd daemon if the underlying bricks use filesystems unknown to gluster (in our case it was a mountbind, which has type of ‘none’).

The problem seems to be in xlators/mgmt/glusterd/src/glusterd-utils.c, in function glusterd_add_inode_size_to_dict,  on line 7296 - the loop iterates over ‘fs’, not ‘glusterd_fs’, therefore ‘glusterd_fs->fs_type_name’ is always ‘xfs’ and fs gets out of bounds, causing the SIGSEGV in strcmp on line 7297. 

--- glusterd-utils.c    2014-11-07 11:55:30.000000000 +0100
+++ glusterd-utils.c_new        2014-11-13 18:09:06.864317759 +0100
@@ -7293,7 +7293,7 @@
         runinit (&runner);
         runner_redir (&runner, STDOUT_FILENO, RUN_PIPE);
 
-        for (fs = glusterd_fs ; glusterd_fs->fs_type_name; fs++) {
+        for (fs = glusterd_fs ; fs->fs_type_name; fs++) {
                 if (strcmp (fs_name, fs->fs_type_name) == 0) {
                         snprintf (fs_tool_name, sizeof fs_tool_name,
                                   "/usr/sbin/%s", fs->fs_tool_name);

Version-Release number of selected component (if applicable):
3.6.1 from official glusterfs yum repository (Centos 6)

How reproducible:
Use filesystem not present in fs_info struct for bricks, for example mountbind, which has type ‘none’.

Steps to Reproduce:
1. mount directory for bricks as mountbinds
2. create and start GlusterFS volume
3. execute gluster volume status ... detail command

Actual results:
Glusterd crashes with SIGSEGV.

Expected results:
No crash :)

Additional info:

--- Additional comment from Kaushal on 2014-11-14 01:23:37 EST ---

Hi Petr,

Thanks for providing the patch. Could you submit the patch for review on our Gerrit instance at https://review.gluster.org . Information on how to submit patches to GlusterFS can be found at http://www.gluster.org/community/documentation/index.php/Simplified_dev_workflow .

If you don't wish to, I can submit it for you.

--- Additional comment from Anand Avati on 2014-11-14 05:03:31 EST ---

REVIEW: http://review.gluster.org/9126 (Fix bug: 1163920 - out of bounds access to fs_info struct) posted (#1) for review on release-3.6 by Petr Medonos (petr.medonos)

--- Additional comment from Anand Avati on 2014-11-17 06:29:47 EST ---

REVIEW: http://review.gluster.org/9126 (mgmt/glusterd: Out of bounds access to fs_info struct) posted (#2) for review on release-3.6 by Petr Medonos (petr.medonos)

--- Additional comment from Anand Avati on 2014-11-17 06:44:21 EST ---

REVIEW: http://review.gluster.org/9138 (mgmt/glusterd: Out of bounds access to fs_info struct) posted (#1) for review on master by Petr Medonos (petr.medonos)

Comment 1 Anand Avati 2014-11-17 12:52:27 UTC
REVIEW: http://review.gluster.org/9138 (mgmt/glusterd: Out of bounds access to fs_info struct) posted (#2) for review on master by Petr Medonos (petr.medonos)

Comment 2 Anand Avati 2014-12-02 03:52:16 UTC
COMMIT: http://review.gluster.org/9138 committed in master by Kaushal M (kaushal) 
------
commit 24581a58e897a415dfcc96f65c41d82d0f1fb49a
Author: Petr Medonos <petr.medonos>
Date:   Mon Nov 17 12:37:25 2014 +0100

    mgmt/glusterd: Out of bounds access to fs_info struct
    
    Change-Id: Ifa0d4ac17f9da94660a7b7f567a0f07b5cec7aec
    BUG: 1164775
    Signed-off-by: Petr Medonos <petr.medonos>
    Reviewed-on: http://review.gluster.org/9138
    Reviewed-by: Krishnan Parthasarathi <kparthas>
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Atin Mukherjee <amukherj>
    Reviewed-by: Kaushal M <kaushal>

Comment 3 Niels de Vos 2015-05-14 17:28:29 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.0, please open a new bug report.

glusterfs-3.7.0 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://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 4 Niels de Vos 2015-05-14 17:35:43 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.0, please open a new bug report.

glusterfs-3.7.0 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://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 5 Niels de Vos 2015-05-14 17:38:05 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.0, please open a new bug report.

glusterfs-3.7.0 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://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 6 Niels de Vos 2015-05-14 17:44:50 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.0, please open a new bug report.

glusterfs-3.7.0 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://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[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.