Blame SOURCES/0060-responder-Fix-talloc-hierarchy-in-sized_output_name.patch

9f2ebf
From af95dd657586d3fc5680a7f8b493a5502640235e Mon Sep 17 00:00:00 2001
9f2ebf
From: Lukas Slebodnik <lslebodn@redhat.com>
9f2ebf
Date: Tue, 28 Nov 2017 12:19:54 +0100
9f2ebf
Subject: [PATCH 60/67] responder: Fix talloc hierarchy in sized_output_name
9f2ebf
MIME-Version: 1.0
9f2ebf
Content-Type: text/plain; charset=UTF-8
9f2ebf
Content-Transfer-Encoding: 8bit
9f2ebf
9f2ebf
sized_output_name was a called with NULL context in
9f2ebf
memcache_delete_entry but returned data from sized_output_name
9f2ebf
didn't have proper talloc hierarchy and we could not release all
9f2ebf
all returned data.
9f2ebf
9f2ebf
==00:01:01:29.871 10088== 934,414 bytes in 8,731 blocks are definitely lost in loss record 121 of 121
9f2ebf
==00:01:01:29.871 10088==    at 0x4C29BE3: malloc (vg_replace_malloc.c:299)
9f2ebf
==00:01:01:29.871 10088==    by 0x8FF4EAB: talloc_strdup (in /usr/lib64/libtalloc.so.2.1.9)
9f2ebf
==00:01:01:29.871 10088==    by 0x52933B9: sss_output_name (usertools.c:808)
9f2ebf
==00:01:01:29.871 10088==    by 0x5293550: sss_output_fqname (usertools.c:863)
9f2ebf
==00:01:01:29.871 10088==    by 0x1211F9: sized_output_name (responder_common.c:1708)
9f2ebf
==00:01:01:29.871 10088==    by 0x1137E6: memcache_delete_entry (nss_get_object.c:112)
9f2ebf
==00:01:01:29.871 10088==    by 0x113BB6: nss_get_object_done (nss_get_object.c:245)
9f2ebf
==00:01:01:29.871 10088==    by 0x8DE5291: _tevent_req_error (in /usr/lib64/libtevent.so.0.9.31)
9f2ebf
==00:01:01:29.871 10088==    by 0x1276CE: cache_req_done (cache_req.c:1047)
9f2ebf
==00:01:01:29.871 10088==    by 0x8DE5291: _tevent_req_error (in /usr/lib64/libtevent.so.0.9.31)
9f2ebf
==00:01:01:29.871 10088==    by 0x126AF6: cache_req_search_domains_done (cache_req.c:607)
9f2ebf
==00:01:01:29.871 10088==    by 0x8DE4AB9: tevent_common_loop_immediate (in /usr/lib64/libtevent.so.0.9.31)
9f2ebf
==00:01:01:29.871 10088==    by 0x8DE9C9C: ??? (in /usr/lib64/libtevent.so.0.9.31)
9f2ebf
==00:01:01:29.871 10088==    by 0x8DE82A6: ??? (in /usr/lib64/libtevent.so.0.9.31)
9f2ebf
==00:01:01:29.871 10088==    by 0x8DE40CC: _tevent_loop_once (in /usr/lib64/libtevent.so.0.9.31)
9f2ebf
==00:01:01:29.871 10088==    by 0x8DE42FA: tevent_common_loop_wait (in /usr/lib64/libtevent.so.0.9.31)
9f2ebf
==00:01:01:29.871 10088==    by 0x8DE8246: ??? (in /usr/lib64/libtevent.so.0.9.31)
9f2ebf
==00:01:01:29.871 10088==    by 0x5291B32: server_loop (server.c:718)
9f2ebf
==00:01:01:29.871 10088==    by 0x11004C: main (nsssrv.c:560)
9f2ebf
9f2ebf
Resolves:
9f2ebf
https://pagure.io/SSSD/sssd/issue/3588
9f2ebf
9f2ebf
Reviewed-by: Fabiano FidĂȘncio <fidencio@redhat.com>
9f2ebf
(cherry picked from commit 06e741a9bf23a18a998f366d9a8990b887a01638)
9f2ebf
---
9f2ebf
 src/responder/common/responder_common.c | 2 +-
9f2ebf
 1 file changed, 1 insertion(+), 1 deletion(-)
9f2ebf
9f2ebf
diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c
9f2ebf
index 6b4d2d9e5936c79944b6f883e9fe46fd03ff32f6..e1100ce4b1eaae8bc561246699dc9bacc96133c8 100644
9f2ebf
--- a/src/responder/common/responder_common.c
9f2ebf
+++ b/src/responder/common/responder_common.c
9f2ebf
@@ -1815,7 +1815,7 @@ int sized_output_name(TALLOC_CTX *mem_ctx,
9f2ebf
         goto done;
9f2ebf
     }
9f2ebf
 
9f2ebf
-    ret = sss_output_fqname(mem_ctx, name_dom, orig_name,
9f2ebf
+    ret = sss_output_fqname(name, name_dom, orig_name,
9f2ebf
                             rctx->override_space, &name_str);
9f2ebf
     if (ret != EOK) {
9f2ebf
         goto done;
9f2ebf
-- 
9f2ebf
2.14.3
9f2ebf