Bug 1386072 - Spurious permission denied problems observed
Summary: Spurious permission denied problems observed
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: posix
Version: 3.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
Depends On: 1386071
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-18 03:26 UTC by Pranith Kumar K
Modified: 2016-12-06 06:00 UTC (History)
1 user (show)

Fixed In Version: glusterfs-3.9.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1386071
Environment:
Last Closed: 2016-12-06 06:00:01 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Pranith Kumar K 2016-10-18 03:26:17 UTC
+++ This bug was initially created as a clone of Bug #1386071 +++

Description of problem:
    Problem:
    When one thread is in the process of creating a file/directory
    and the other thread is doing readdirp, there is a chance that
    posix_pstat, creation fops race in the following manner which
    will lead to wrong stat values to be read by parent xlators
    like posix-acl.
    
    Creation fops                           posix_pstat() as part of readdirp
    1) file is created with uid/gid 0/0     1) does stat of the path that
                                               is created just now.
    2) Does chown to set the correct
       uid/gid
    3) Sets the acl/user/internal xattrs
    4) Sets the gfid on the entry and
       completes the creation of the file/dir
                                            2) fills the gfid in the iatt
    
    If unwind of readdirp hits server xlator before creation fop, then
    posix-acl remembers uid/gid of the file to be root/root and fails
    fops like open etc on it.
    
    Fix:
    Reverse the order of filling gfid and filling lstat() values in
    posix_pstat() so that if there is gfid in iatt buffer uid/gid
    are valid.
    


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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Worker Ant 2016-10-18 03:28:22 UTC
REVIEW: http://review.gluster.org/15664 (storage/posix: Fix race in posix_pstat) posted (#1) for review on release-3.9 by Pranith Kumar Karampuri (pkarampu)

Comment 2 Worker Ant 2016-10-25 10:19:19 UTC
COMMIT: http://review.gluster.org/15664 committed in release-3.9 by Pranith Kumar Karampuri (pkarampu) 
------
commit 10f2cbdfe6b375dbe602ba2c1da09008057f52c8
Author: Pranith Kumar K <pkarampu>
Date:   Fri Sep 23 21:06:37 2016 +0530

    storage/posix: Fix race in posix_pstat
    
    Problem:
    When one thread is in the process of creating a file/directory
    and the other thread is doing readdirp, there is a chance that
    posix_pstat, creation fops race in the following manner which
    will lead to wrong stat values to be read by parent xlators
    like posix-acl.
    
    Creation fops                           posix_pstat() as part of readdirp
    1) file is created with uid/gid 0/0     1) does stat of the path that
                                               is created just now.
    2) Does chown to set the correct
       uid/gid
    3) Sets the acl/user/internal xattrs
    4) Sets the gfid on the entry and
       completes the creation of the file/dir
                                            2) fills the gfid in the iatt
    
    If unwind of readdirp hits server xlator before creation fop, then
    posix-acl remembers uid/gid of the file to be root/root and fails
    fops like open etc on it.
    
    Fix:
    Reverse the order of filling gfid and filling lstat() values in
    posix_pstat() so that if there is gfid in iatt buffer uid/gid
    are valid.
    
     >Change-Id: I46caa7f6da7abfa40a0b1d70e35b88de9c64959c
     >Signed-off-by: Pranith Kumar K <pkarampu>
     >Reviewed-on: http://review.gluster.org/15564
     >NetBSD-regression: NetBSD Build System <jenkins.org>
     >CentOS-regression: Gluster Build System <jenkins.org>
     >Smoke: Gluster Build System <jenkins.org>
     >Reviewed-by: Shyamsundar Ranganathan <srangana>
    
    BUG: 1386072
    Change-Id: Ida2bd7297de8e7f51bcb7deda8936ce64ea8ec2b
    Signed-off-by: Pranith Kumar K <pkarampu>
    Reviewed-on: http://review.gluster.org/15664
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Smoke: Gluster Build System <jenkins.org>

Comment 3 Aravinda VK 2016-10-27 05:22:44 UTC
glusterfs-3.9.0rc2 is released[1] and packages are available for different distributions[2] to test.

[1] http://www.gluster.org/pipermail/maintainers/2016-October/001601.html
[2] http://www.gluster.org/pipermail/maintainers/2016-October/001605.html and http://www.gluster.org/pipermail/maintainers/2016-October/001606.html

Comment 4 Aravinda VK 2016-12-06 06:00:01 UTC
Gluster 3.9 GA is released http://blog.gluster.org/2016/11/announcing-gluster-3-9/


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