From 230113feeee0790412a98e8e390dda3c871e0ec4 Mon Sep 17 00:00:00 2001 From: Tomas Hozza Date: Wed, 5 Mar 2014 14:37:50 +0100 Subject: Fix two issues - dlz_dlopen driver could return the wrong error leading to a segfault (#1052781) - Fix race condition when freeing fetch object (ISC-Bugs #35385) Signed-off-by: Tomas Hozza --- bind-99-ISC-Bugs-35385.patch | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 bind-99-ISC-Bugs-35385.patch (limited to 'bind-99-ISC-Bugs-35385.patch') diff --git a/bind-99-ISC-Bugs-35385.patch b/bind-99-ISC-Bugs-35385.patch new file mode 100644 index 0000000..a8795fb --- /dev/null +++ b/bind-99-ISC-Bugs-35385.patch @@ -0,0 +1,39 @@ +diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c +index 7023a82..d7f817c 100644 +--- a/lib/dns/resolver.c ++++ b/lib/dns/resolver.c +@@ -351,6 +351,7 @@ typedef struct { + + struct dns_fetch { + unsigned int magic; ++ isc_mem_t * mctx; + fetchctx_t * private; + }; + +@@ -8416,6 +8417,8 @@ dns_resolver_createfetch2(dns_resolver_t *res, dns_name_t *name, + fetch = isc_mem_get(res->mctx, sizeof(*fetch)); + if (fetch == NULL) + return (ISC_R_NOMEMORY); ++ fetch->mctx = NULL; ++ isc_mem_attach(res->mctx, &fetch->mctx); + + bucketnum = dns_name_fullhash(name, ISC_FALSE) % res->nbuckets; + +@@ -8506,7 +8509,7 @@ dns_resolver_createfetch2(dns_resolver_t *res, dns_name_t *name, + FTRACE("created"); + *fetchp = fetch; + } else +- isc_mem_put(res->mctx, fetch, sizeof(*fetch)); ++ isc_mem_putanddetach(&fetch->mctx, fetch, sizeof(*fetch)); + + return (result); + } +@@ -8597,7 +8600,7 @@ dns_resolver_destroyfetch(dns_fetch_t **fetchp) { + + UNLOCK(&res->buckets[bucketnum].lock); + +- isc_mem_put(res->mctx, fetch, sizeof(*fetch)); ++ isc_mem_putanddetach(&fetch->mctx, fetch, sizeof(*fetch)); + *fetchp = NULL; + + if (bucket_empty) -- cgit