summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShreyas Siravara <sshreyas@fb.com>2016-06-08 11:53:59 -0700
committerShreyas Siravara <sshreyas@fb.com>2017-08-30 14:06:24 +0000
commitf2d57485d57e14a064c9ca6e83fe6c92131a8e37 (patch)
treef2d6b08919dee3f096862c31aebe112ef03427f7
parent69509ee7d270302c232556b5c941fb6a22b4dced (diff)
nfs: Fix crash bug when mnt3_resolve_subdir_cbk() fails
Summary: When mnt3_resolve_subdir_cbk() fails (this can happen when we race with gfs_stress.sh), authorized_path is sometimes NULL. We try to run strlen() on this path and as a result we crash. This diff fixes that by checking if path is NULL before dereferencing it. This bug exists in fb-release-3.6.3 & fb-release-3.6.3-stable. - This is a port of D3406533 to release-3.8-fb Test Plan: Run with patch and observe that there is no crash. Prove test for auth code. Reviewers: rwareing, kvigor Reviewed By: kvigor Subscribers: #posix_storage Change-Id: Ib24a9b640b066f72db30e9e08fccc512c0ff7bb6 Reviewed-on: https://review.gluster.org/18155 Reviewed-by: Shreyas Siravara <sshreyas@fb.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org>
-rw-r--r--xlators/nfs/server/src/mount3.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c
index 525c83c150f..1cc0b07a9a6 100644
--- a/xlators/nfs/server/src/mount3.c
+++ b/xlators/nfs/server/src/mount3.c
@@ -701,6 +701,9 @@ __mnt3_build_mountid_from_path (const char *path, uuid_t mountid)
uint32_t hashed_path = 0;
int ret = -1;
+ if (!path)
+ goto out;
+
while (strlen (path) > 0 && path[0] == '/')
path++;