14f8ab
From 1aa175f353325775517daf1d48a19799e0cafc7a Mon Sep 17 00:00:00 2001
14f8ab
From: Pranith Kumar K <pkarampu@redhat.com>
14f8ab
Date: Mon, 22 Jul 2019 20:55:33 +0530
14f8ab
Subject: [PATCH 261/261] features/utime: Fix mem_put crash
14f8ab
14f8ab
Problem:
14f8ab
When frame->local is not null FRAME_DESTROY calls mem_put on it.
14f8ab
Since the stub is already destroyed in call_resume(), it leads
14f8ab
to crash
14f8ab
14f8ab
Fix:
14f8ab
Set frame->local to NULL before calling call_resume()
14f8ab
14f8ab
Backport of:
14f8ab
 > Patch: https://review.gluster.org/23091
14f8ab
 > fixes: bz#1593542
14f8ab
 > Change-Id: I0f8adf406f4cefdb89d7624ba7a9d9c2eedfb1de
14f8ab
 > Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
14f8ab
14f8ab
BUG: 1715422
14f8ab
Change-Id: I0f8adf406f4cefdb89d7624ba7a9d9c2eedfb1de
14f8ab
Signed-off-by: Kotresh HR <khiremat@redhat.com>
14f8ab
Reviewed-on: https://code.engineering.redhat.com/gerrit/176726
14f8ab
Tested-by: RHGS Build Bot <nigelb@redhat.com>
14f8ab
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
14f8ab
---
14f8ab
 xlators/features/utime/src/utime.c | 4 +++-
14f8ab
 1 file changed, 3 insertions(+), 1 deletion(-)
14f8ab
14f8ab
diff --git a/xlators/features/utime/src/utime.c b/xlators/features/utime/src/utime.c
14f8ab
index 2a986e7..e3a80b6 100644
14f8ab
--- a/xlators/features/utime/src/utime.c
14f8ab
+++ b/xlators/features/utime/src/utime.c
14f8ab
@@ -139,12 +139,14 @@ gf_utime_set_mdata_setxattr_cbk(call_frame_t *frame, void *cookie,
14f8ab
                                 xlator_t *this, int op_ret, int op_errno,
14f8ab
                                 dict_t *xdata)
14f8ab
 {
14f8ab
+    call_stub_t *stub = frame->local;
14f8ab
     /* Don't fail lookup if mdata setxattr fails */
14f8ab
     if (op_ret) {
14f8ab
         gf_msg(this->name, GF_LOG_ERROR, op_errno, UTIME_MSG_SET_MDATA_FAILED,
14f8ab
                "dict set of key for set-ctime-mdata failed");
14f8ab
     }
14f8ab
-    call_resume(frame->local);
14f8ab
+    frame->local = NULL;
14f8ab
+    call_resume(stub);
14f8ab
     return 0;
14f8ab
 }
14f8ab
 
14f8ab
-- 
14f8ab
1.8.3.1
14f8ab