dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0048-fp-fix-original-fix-use-after-free-1.16-version.patch

32a074
From 1b523ba2a6bfba6974c9c909d6180590d16cc6bd Mon Sep 17 00:00:00 2001
32a074
From: Sumit Bose <sbose@redhat.com>
32a074
Date: Mon, 23 Nov 2020 13:40:30 +0100
32a074
Subject: [PATCH] fp: fix original fix use-after-free - 1.16 version
32a074
32a074
This should have been a cherry-pick of
32a074
3b158934cbb8f87cbfaf1650389b8dcd654b92ca but the cherry-pick of the
32a074
original patch was broken and placed the change into a different function.
32a074
32a074
This patch fixes this by directly placing the change at the right place.
32a074
32a074
Resolves:
32a074
https://github.com/SSSD/sssd/issues/5382
32a074
32a074
Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>
32a074
---
32a074
 src/responder/ifp/ifpsrv_cmd.c | 4 ++--
32a074
 1 file changed, 2 insertions(+), 2 deletions(-)
32a074
32a074
diff --git a/src/responder/ifp/ifpsrv_cmd.c b/src/responder/ifp/ifpsrv_cmd.c
32a074
index d83600681..620afe86a 100644
32a074
--- a/src/responder/ifp/ifpsrv_cmd.c
32a074
+++ b/src/responder/ifp/ifpsrv_cmd.c
32a074
@@ -124,7 +124,6 @@ ifp_user_get_attr_unpack_msg(struct ifp_attr_req *attr_req)
32a074
     if (attr_req->attrs == NULL) {
32a074
         return ENOMEM;
32a074
     }
32a074
-    fqdn = talloc_steal(state, fqdn);
32a074
 
32a074
     ai = 0;
32a074
     for (i = 0; i < nattrs; i++) {
32a074
@@ -576,7 +575,8 @@ static void ifp_user_get_attr_done(struct tevent_req *subreq)
32a074
     }
32a074
 
32a074
     if (state->search_type == SSS_DP_USER) {
32a074
-        /* throw away the result and perform attr search */
32a074
+        /* throw away the result but keep the fqdn and perform attr search */
32a074
+        fqdn = talloc_steal(state, fqdn);
32a074
         talloc_zfree(state->res);
32a074
 
32a074
         ret = sysdb_get_user_attr_with_views(state, state->dom, fqdn,
32a074
-- 
32a074
2.21.3
32a074