summaryrefslogtreecommitdiffstats
path: root/bind-99-ISC-Bugs-35385.patch
diff options
context:
space:
mode:
authorTomas Hozza <thozza@redhat.com>2014-03-05 14:37:50 +0100
committerTomas Hozza <thozza@redhat.com>2014-03-05 14:43:00 +0100
commit230113feeee0790412a98e8e390dda3c871e0ec4 (patch)
tree2bd0920865e4f5a4785761beccf6ac4ce97ba53b /bind-99-ISC-Bugs-35385.patch
parent7ebf9a3e72d57bcf2e54a7a9df993f5ea721c641 (diff)
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 <thozza@redhat.com>
Diffstat (limited to 'bind-99-ISC-Bugs-35385.patch')
-rw-r--r--bind-99-ISC-Bugs-35385.patch39
1 files changed, 39 insertions, 0 deletions
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)