[Bugs] [Bug 1240920] New: libgfapi: Segfault seen when glfs_*() methods are invoked with invalid glfd

bugzilla at redhat.com bugzilla at redhat.com
Wed Jul 8 06:53:42 UTC 2015


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

            Bug ID: 1240920
           Summary: libgfapi: Segfault seen when glfs_*() methods are
                    invoked with invalid glfd
           Product: GlusterFS
           Version: 3.7.2
         Component: libgfapi
          Severity: low
          Priority: high
          Assignee: bugs at gluster.org
          Reporter: ppai at redhat.com
        QA Contact: sdharane at redhat.com
                CC: bugs at gluster.org, gluster-bugs at redhat.com,
                    sdharane at redhat.com
        Depends On: 1221008
            Blocks: 1233025 (glusterfs-3.7.3)



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

Description of problem:
When glfs_* methods operating on glfd are invoked after calling
glfs_close(), the program segfaults inside __GLFS_ENTRY_VALIDATE_FD
trying to deference glfd->fd->inode which is invalid.

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


Steps to Reproduce (Example using python binding)
#!/usr/bin/env python

from glusterfs import gfapi
import os

v = gfapi.Volume("pp", "real")
v.mount()
f = v.open("file", os.O_RDONLY) # assuming file exists
f.close()
f.read() # This will segfault


Actual results:
Segfault with code dump

Expected results:
Gracefully exit with errno set to EBADF

--- Additional comment from Anand Avati on 2015-05-13 02:25:55 EDT ---

REVIEW: http://review.gluster.org/10759 (libgfapi: Gracefully exit when glfd is
invalid) posted (#3) for review on master by Prashanth Pai (ppai at redhat.com)

--- Additional comment from Anand Avati on 2015-05-13 02:46:40 EDT ---

REVIEW: http://review.gluster.org/10759 (libgfapi: Gracefully exit when glfd is
invalid) posted (#4) for review on master by Prashanth Pai (ppai at redhat.com)

--- Additional comment from Anand Avati on 2015-05-14 00:32:43 EDT ---

REVIEW: http://review.gluster.org/10759 (libgfapi: Gracefully exit when glfd is
invalid) posted (#5) for review on master by Prashanth Pai (ppai at redhat.com)

--- Additional comment from Anand Avati on 2015-07-07 11:06:46 EDT ---

COMMIT: http://review.gluster.org/10759 committed in master by Shyamsundar
Ranganathan (srangana at redhat.com) 
------
commit afa793ff16b349989ca7c958466eae15d2d003f9
Author: Prashanth Pai <ppai at redhat.com>
Date:   Tue May 12 16:36:55 2015 +0530

    libgfapi: Gracefully exit when glfd is invalid

    When glfs_* methods operating on glfd are invoked after calling
    glfs_close(), the program segfaults inside __GLFS_ENTRY_VALIDATE_FD
    trying to deference glfd->fd->inode which is invalid.

    Also, returning EBADF seemed more specific than EINVAL.

    BUG: 1221008
    Change-Id: I13a92dca52da9a300252b69e026581b3a9e931fd
    Signed-off-by: Prashanth Pai <ppai at redhat.com>
    Reviewed-on: http://review.gluster.org/10759
    Tested-by: Gluster Build System <jenkins at build.gluster.com>
    Reviewed-by: Shyamsundar Ranganathan <srangana at redhat.com>

--- Additional comment from Anand Avati on 2015-07-08 02:39:13 EDT ---

REVIEW: http://review.gluster.org/11571 (libgfapi: Gracefully exit when glfd is
invalid) posted (#1) for review on release-3.7 by Prashanth Pai
(ppai at redhat.com)


Referenced Bugs:

https://bugzilla.redhat.com/show_bug.cgi?id=1221008
[Bug 1221008] libgfapi: Segfault seen when glfs_*() methods are invoked
with invalid glfd
https://bugzilla.redhat.com/show_bug.cgi?id=1233025
[Bug 1233025] GlusterFS 3.7.3 tracker
-- 
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