[Bugs] [Bug 1595528] New: rmdir is leaking softlinks to directories in .glusterfs

bugzilla at redhat.com bugzilla at redhat.com
Wed Jun 27 05:02:56 UTC 2018


https://bugzilla.redhat.com/show_bug.cgi?id=1595528

            Bug ID: 1595528
           Summary: rmdir is leaking softlinks to directories in
                    .glusterfs
           Product: GlusterFS
           Version: 3.12
         Component: posix
          Assignee: bugs at gluster.org
          Reporter: pkarampu at redhat.com
                CC: bugs at gluster.org
        Depends On: 1595190, 1595524



+++ This bug was initially created as a clone of Bug #1595524 +++

+++ This bug was initially created as a clone of Bug #1595190 +++

Description of problem:
storage/posix: Fix posix_symlinks_match()

1) snprintf into linkname_expected should happen with PATH_MAX
2) comparison should happen with linkname_actual with string linkname_expected

114    posix_symlinks_match (xlator_t *this, loc_t *loc, uuid_t gfid)
115    {
116            struct posix_private *priv = NULL;
117            char linkname_actual[PATH_MAX] = {0,};
118            char linkname_expected[PATH_MAX] = {0};
119            char *dir_handle = NULL;
(gdb) 
120            size_t len = 0;
121            size_t handle_size = 0;
122            gf_boolean_t ret = _gf_false;
123    
124            priv = this->private;
125            handle_size = POSIX_GFID_HANDLE_SIZE(priv->base_path_length);
126            dir_handle = alloca0 (handle_size);
127    
128            snprintf (linkname_expected, handle_size,
"../../%02x/%02x/%s/%s",

<<<<<<<<< s/handle_size/PATH_MAX

129                      loc->pargfid[0], loc->pargfid[1], uuid_utoa
(loc->pargfid),
(gdb) 
130                      loc->name);
131    
132            MAKE_HANDLE_GFID_PATH (dir_handle, this, gfid, NULL);
133            len = sys_readlink (dir_handle, linkname_actual, PATH_MAX);
134            if (len < 0)
135                    goto out;
136            linkname_actual[len] = '\0';
137    
138            if (!strncmp (linkname_actual, linkname_expected, handle_size))
139                    ret = _gf_true;
(gdb) p handle_size
$12 = 77
(gdb) q
A debugging session is active.

(gdb) p linkname_actual 
$9 =
"../../78/2f/782f8b99-a965-4b32-95ff-b698fdb0a08e/_gqac023.sbu.lab.eng.bos.redhat.com_00_1_.d",
'\000' <repeats 4003 times>
(gdb) p linkname_expected 
$10 =
"../../78/2f/782f8b99-a965-4b32-95ff-b698fdb0a08e/_gqac023.sbu.lab.eng.bos.re",
'\000' <repeats 4019 times>


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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Worker Ant on 2018-06-26 08:20:45 EDT ---

REVIEW: https://review.gluster.org/20392 (storage/posix: Fix
posix_symlinks_match()) posted (#1) for review on master by Pranith Kumar
Karampuri

--- Additional comment from Worker Ant on 2018-06-26 23:21:51 EDT ---

COMMIT: https://review.gluster.org/20392 committed in master by "Pranith Kumar
Karampuri" <pkarampu at redhat.com> with a commit message- storage/posix: Fix
posix_symlinks_match()

1) snprintf into linkname_expected should happen with PATH_MAX
2) comparison should happen with linkname_actual with complete
   string linkname_expected

fixes bz#1595190
Change-Id: Ic3b3c362dc6c69c046b9a13e031989be47ecff14
Signed-off-by: Pranith Kumar K <pkarampu at redhat.com>

--- Additional comment from Worker Ant on 2018-06-27 00:55:19 EDT ---

REVIEW: https://review.gluster.org/20398 (storage/posix: Fix
posix_symlinks_match()) posted (#1) for review on release-4.1 by Pranith Kumar
Karampuri


Referenced Bugs:

https://bugzilla.redhat.com/show_bug.cgi?id=1595190
[Bug 1595190] rmdir is leaking softlinks to directories in .glusterfs
https://bugzilla.redhat.com/show_bug.cgi?id=1595524
[Bug 1595524] rmdir is leaking softlinks to directories in .glusterfs
-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.


More information about the Bugs mailing list