URL: https://github.com/SSSD/sssd/pull/443
Author: fidencio
 Title: #443: NSS: Use enum_ctx as memory_context in _setnetgrent_set_timeout()
Action: opened

PR body:
"""
We've noticed some crashes that happened because enum_ctx is already
freed, but the timeout handler is still called. In order to avoid that,
let's remove the timeout handler when enum_ctx is freed at other places.

Resolves: https://pagure.io/SSSD/sssd/issue/3523

Signed-off-by: Fabiano FidĂȘncio <[email protected]>

PS: While I wasn't able to reproduce the issue, a customer confirmed this patch 
solved their problem.
"""

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/443/head:pr443
git checkout pr443
From 38ff4a6c73cbc17b0e440d975684e048c56901b4 Mon Sep 17 00:00:00 2001
From: Sumit Bose <[email protected]>
Date: Mon, 6 Nov 2017 17:03:19 +0100
Subject: [PATCH] NSS: Use enum_ctx as memory_context in
 _setnetgrent_set_timeout()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We've noticed some crashes that happened because enum_ctx is already
freed, but the timeout handler is still called. In order to avoid that,
let's remove the timeout handler when enum_ctx is freed at other places.

Resolves: https://pagure.io/SSSD/sssd/issue/3523

Signed-off-by: Fabiano FidĂȘncio <[email protected]>
---
 src/responder/nss/nss_enum.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/responder/nss/nss_enum.c b/src/responder/nss/nss_enum.c
index aa7d8428f..da844fbce 100644
--- a/src/responder/nss/nss_enum.c
+++ b/src/responder/nss/nss_enum.c
@@ -283,7 +283,7 @@ nss_setnetgrent_set_timeout(struct tevent_context *ev,
     timeout = enum_ctx->result[0]->domain->netgroup_timeout;
 
     tv = tevent_timeval_current_ofs(timeout, 0);
-    te = tevent_add_timer(ev, nss_ctx, tv, nss_setnetgrent_timeout, enum_ctx);
+    te = tevent_add_timer(ev, enum_ctx, tv, nss_setnetgrent_timeout, enum_ctx);
     if (te == NULL) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Could not set up life timer for enumeration object.\n");
_______________________________________________
sssd-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to