summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2016-12-14 08:47:28 +0100
committerNiels de Vos <ndevos@redhat.com>2016-12-19 05:03:44 -0800
commit9eb9a82438ccce41b2c542093b969f39ddef25c0 (patch)
tree0cc508a65a65eee23bedc790b54f5d723767a2ba
parent5de5060df16597a4e1f9981616816018db3fea19 (diff)
upcall: Fix 'use after free' in a log message
There is chance of accessing freed pointer in a log message at TRACE level while cleaning up expired client entries. Cherry picked from commit 212c7600d2070a4414bc89fd7d2c186b5994cd54: > Change-Id: I06b4dad755df63978ab04ca52442bfd4600d139a > BUG: 1404168 > Reported-by: Ravishankar N <ravishankar@redhat.com> > Signed-off-by: Soumya Koduri <skoduri@redhat.com> > Reviewed-on: http://review.gluster.org/16117 > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > Reviewed-by: Niels de Vos <ndevos@redhat.com> > Smoke: Gluster Build System <jenkins@build.gluster.org> Change-Id: I06b4dad755df63978ab04ca52442bfd4600d139a BUG: 1404586 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/16129 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: soumya k <skoduri@redhat.com>
-rw-r--r--xlators/features/upcall/src/upcall-internal.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/xlators/features/upcall/src/upcall-internal.c b/xlators/features/upcall/src/upcall-internal.c
index 05b054b..b4b4931 100644
--- a/xlators/features/upcall/src/upcall-internal.c
+++ b/xlators/features/upcall/src/upcall-internal.c
@@ -284,6 +284,11 @@ upcall_cleanup_expired_clients (xlator_t *this,
up_client->access_time;
if (t_expired > (2*timeout)) {
+
+ gf_log (THIS->name, GF_LOG_TRACE,
+ "Cleaning up client_entry(%s)",
+ up_client->client_uid);
+
ret =
__upcall_cleanup_client_entry (up_client);
@@ -294,9 +299,6 @@ upcall_cleanup_expired_clients (xlator_t *this,
up_client);
goto out;
}
- gf_log (THIS->name, GF_LOG_TRACE,
- "Cleaned up client_entry(%s)",
- up_client->client_uid);
}
}
}