Bug 1113960

Summary: brick process crashed when rebalance and rename was in progress
Product: [Community] GlusterFS Reporter: Nithya Balachandran <nbalacha>
Component: posixAssignee: Nithya Balachandran <nbalacha>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: mainlineCC: gluster-bugs, mzywusko, nbalacha, nlevinki, nsathyan, rcyriac, sdharane, smohan, ssamanta, vbellur
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: glusterfs-3.7.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1110730 Environment:
Last Closed: 2015-05-14 17:26:07 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:
Bug Depends On: 1110730, 1165897    
Bug Blocks:    

Comment 1 Anand Avati 2014-06-27 11:02:50 UTC
REVIEW: http://review.gluster.org/8189 (Glusterfs/posix: Stack corruption in posix_handle_pump) posted (#1) for review on master by N Balachandran (nbalacha)

Comment 2 Anand Avati 2014-06-27 11:12:08 UTC
REVIEW: http://review.gluster.org/8189 (Glusterfs/posix: Stack corruption in posix_handle_pump) posted (#2) for review on master by N Balachandran (nbalacha)

Comment 3 Anand Avati 2014-12-04 06:12:19 UTC
COMMIT: http://review.gluster.org/8189 committed in master by Pranith Kumar Karampuri (pkarampu) 
------
commit ac4c203bfb4c3ebe48a08ef695ee462ba9b5e2c7
Author: Nithya Balachandran <nbalacha>
Date:   Fri Jun 27 16:28:52 2014 +0530

    Glusterfs/posix: Stack corruption in posix_handle_pump
    
    posix_handle_pump can corrupt the stack if the buffer
    passed to it is too small to hold the final path.
    
    Fix :
    Check if the buffer is sufficiently large to hold the new path
    component before modifying it. This will prevent the buffer
    overrun but the path returned will most likely have too many symbolic
    links causing subsequent file ops to fail with ELOOP.
    
    The callers of this function do not currently check the return value.
    The code needs to be modified to have all callers check the return
    value and take appropriate action in case of an error.
    
    Change-Id: I6d9589195a4b0d971a107514ded6e97381e5982e
    BUG: 1113960
    Signed-off-by: Nithya Balachandran <nbalacha>
    Reviewed-on: http://review.gluster.org/8189
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Raghavendra G <rgowdapp>
    Reviewed-by: Pranith Kumar Karampuri <pkarampu>
    Tested-by: Pranith Kumar Karampuri <pkarampu>

Comment 4 Anand Avati 2014-12-17 09:48:47 UTC
REVIEW: http://review.gluster.org/9289 (Storage/posix : Adding error checks in path formation) posted (#3) for review on master by N Balachandran (nbalacha)

Comment 5 Anand Avati 2014-12-19 14:18:57 UTC
REVIEW: http://review.gluster.org/9289 (Storage/posix : Adding error checks in path formation) posted (#4) for review on master by N Balachandran (nbalacha)

Comment 6 Anand Avati 2014-12-23 09:43:52 UTC
REVIEW: http://review.gluster.org/9289 (Storage/posix : Adding error checks in path formation) posted (#7) for review on master by N Balachandran (nbalacha)

Comment 7 Anand Avati 2014-12-24 12:14:45 UTC
REVIEW: http://review.gluster.org/9289 (Storage/posix : Adding error checks in path formation) posted (#8) for review on master by N Balachandran (nbalacha)

Comment 8 Anand Avati 2014-12-26 07:20:13 UTC
REVIEW: http://review.gluster.org/9289 (Storage/posix : Adding error checks in path formation) posted (#9) for review on master by N Balachandran (nbalacha)

Comment 9 Anand Avati 2014-12-26 09:51:40 UTC
REVIEW: http://review.gluster.org/9289 (Storage/posix : Adding error checks in path formation) posted (#10) for review on master by N Balachandran (nbalacha)

Comment 10 Anand Avati 2014-12-26 10:29:20 UTC
REVIEW: http://review.gluster.org/9289 (Storage/posix : Adding error checks in path formation) posted (#11) for review on master by N Balachandran (nbalacha)

Comment 11 Anand Avati 2015-01-29 16:31:53 UTC
REVIEW: http://review.gluster.org/9289 (Storage/posix : Adding error checks in path formation) posted (#12) for review on master by N Balachandran (nbalacha)

Comment 12 Anand Avati 2015-01-29 16:41:51 UTC
REVIEW: http://review.gluster.org/9289 (Storage/posix : Adding error checks in path formation) posted (#13) for review on master by N Balachandran (nbalacha)

Comment 13 Anand Avati 2015-01-30 09:00:33 UTC
REVIEW: http://review.gluster.org/9289 (Storage/posix : Adding error checks in path formation) posted (#14) for review on master by N Balachandran (nbalacha)

Comment 14 Anand Avati 2015-02-16 09:49:36 UTC
REVIEW: http://review.gluster.org/9289 (Storage/posix : Adding error checks in path formation) posted (#15) for review on master by N Balachandran (nbalacha)

Comment 15 Anand Avati 2015-02-17 04:29:08 UTC
REVIEW: http://review.gluster.org/9289 (Storage/posix : Adding error checks in path formation) posted (#16) for review on master by N Balachandran (nbalacha)

Comment 16 Anand Avati 2015-02-17 06:56:25 UTC
REVIEW: http://review.gluster.org/9289 (Storage/posix : Adding error checks in path formation) posted (#17) for review on master by N Balachandran (nbalacha)

Comment 17 Anand Avati 2015-02-19 06:55:12 UTC
COMMIT: http://review.gluster.org/9289 committed in master by Raghavendra Bhat (raghavendra) 
------
commit f1c4ce0e220a46b7a43c9303c0d137498d421101
Author: Nithya Balachandran <nbalacha>
Date:   Wed Dec 17 13:58:56 2014 +0530

    Storage/posix : Adding error checks in path formation
    
    Renaming directories can cause the size of the buffer
    required for posix_handle_path to increase between the
    first call, which calculates the size, and the second call
    which forms the path in the buffer allocated based on
    the size calculated in the first call.
    
    The path created in the second call overflows the
    allocated buffer and overwrites the stack causing the
    brick process to crash.
    
    The fix adds a buffer size check to prevent the buffer
    overflow. It also checks and returns an error if the
    posix_handle_path call is unable to form the path instead
    of working on the incomplete path, which is likely to cause
    subsequent calls using the path to fail with ELOOP.
    
    Preventing buffer overflow and handling errors
    BUG: 1113960
    
    Change-Id: If3d3c1952e297ad14f121f05f90a35baf42923aa
    Signed-off-by: Nithya Balachandran <nbalacha>
    Reviewed-on: http://review.gluster.org/9289
    Reviewed-by: Pranith Kumar Karampuri <pkarampu>
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Raghavendra Bhat <raghavendra>

Comment 18 Anand Avati 2015-02-19 12:03:01 UTC
REVIEW: http://review.gluster.org/9702 (Storage/posix : Adding error checks in path formation) posted (#1) for review on master by N Balachandran (nbalacha)

Comment 19 Anand Avati 2015-02-20 06:08:24 UTC
COMMIT: http://review.gluster.org/9702 committed in master by Raghavendra Bhat (raghavendra) 
------
commit d8f181d3171ed301a9992615083fcf98992577c8
Author: Nithya Balachandran <nbalacha>
Date:   Thu Feb 19 17:30:35 2015 +0530

    Storage/posix : Adding error checks in path formation
    
    Modified a few log messages added for this fix.
    Also set the op_errno in an error check.
    
    Change-Id: I87caf2f89031aedad1aaee001aef54896dbecd3b
    BUG: 1113960
    Signed-off-by: Nithya Balachandran <nbalacha>
    Reviewed-on: http://review.gluster.org/9702
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Pranith Kumar Karampuri <pkarampu>
    Reviewed-by: Raghavendra Bhat <raghavendra>

Comment 20 Niels de Vos 2015-05-14 17:26:07 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 21 Niels de Vos 2015-05-14 17:35:27 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 22 Niels de Vos 2015-05-14 17:37:49 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 23 Niels de Vos 2015-05-14 17:42:30 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