aboutsummaryrefslogtreecommitdiffstats
path: root/dns
diff options
context:
space:
mode:
authordougb <dougb@FreeBSD.org>2005-08-19 03:12:08 +0800
committerdougb <dougb@FreeBSD.org>2005-08-19 03:12:08 +0800
commited3a36da56280c087084f7fa0f3c26d1140e4120 (patch)
treee2f78653d160eb219da0451bae7b4be367cea064 /dns
parent79cf83fb494f382eb181c5a6c080d64f7ada6cce (diff)
downloadfreebsd-ports-gnome-ed3a36da56280c087084f7fa0f3c26d1140e4120.tar.gz
freebsd-ports-gnome-ed3a36da56280c087084f7fa0f3c26d1140e4120.tar.zst
freebsd-ports-gnome-ed3a36da56280c087084f7fa0f3c26d1140e4120.zip
This issue was researched by glebius, and this patch was
incorporated by ISC into the next version of BIND. The patch addresses a problem with high-load resolvers which hit memory barriers. Without this patch, running the resolving name server out of memory would lead to "unpredictable results." Of course, the canonical answer to this problem is to put more memory into the system, however that is not always possible, and the code should be able to handle this situation gracefully in any case. Approved by: portmgr (krion)
Diffstat (limited to 'dns')
-rw-r--r--dns/bind9/files/patch-lib_dns_resolver.c23
-rw-r--r--dns/bind94/files/patch-lib_dns_resolver.c23
-rw-r--r--dns/bind95/files/patch-lib_dns_resolver.c23
-rw-r--r--dns/bind96/files/patch-lib_dns_resolver.c23
4 files changed, 92 insertions, 0 deletions
diff --git a/dns/bind9/files/patch-lib_dns_resolver.c b/dns/bind9/files/patch-lib_dns_resolver.c
new file mode 100644
index 000000000000..5605bb71f3ec
--- /dev/null
+++ b/dns/bind9/files/patch-lib_dns_resolver.c
@@ -0,0 +1,23 @@
+--- lib/dns/resolver.c.orig Tue Feb 8 15:59:44 2005
++++ lib/dns/resolver.c Wed Aug 17 02:42:48 2005
+@@ -2665,7 +2665,7 @@
+ unsigned int options, unsigned int bucketnum, fetchctx_t **fctxp)
+ {
+ fetchctx_t *fctx;
+- isc_result_t result = ISC_R_SUCCESS;
++ isc_result_t result;
+ isc_result_t iresult;
+ isc_interval_t interval;
+ dns_fixedname_t qdomain;
+@@ -2687,8 +2687,10 @@
+ strcat(buf, "/"); /* checked */
+ strcat(buf, typebuf); /* checked */
+ fctx->info = isc_mem_strdup(res->mctx, buf);
+- if (fctx->info == NULL)
++ if (fctx->info == NULL) {
++ result = ISC_R_NOMEMORY;
+ goto cleanup_fetch;
++ }
+ FCTXTRACE("create");
+ dns_name_init(&fctx->name, NULL);
+ result = dns_name_dup(name, res->mctx, &fctx->name);
diff --git a/dns/bind94/files/patch-lib_dns_resolver.c b/dns/bind94/files/patch-lib_dns_resolver.c
new file mode 100644
index 000000000000..5605bb71f3ec
--- /dev/null
+++ b/dns/bind94/files/patch-lib_dns_resolver.c
@@ -0,0 +1,23 @@
+--- lib/dns/resolver.c.orig Tue Feb 8 15:59:44 2005
++++ lib/dns/resolver.c Wed Aug 17 02:42:48 2005
+@@ -2665,7 +2665,7 @@
+ unsigned int options, unsigned int bucketnum, fetchctx_t **fctxp)
+ {
+ fetchctx_t *fctx;
+- isc_result_t result = ISC_R_SUCCESS;
++ isc_result_t result;
+ isc_result_t iresult;
+ isc_interval_t interval;
+ dns_fixedname_t qdomain;
+@@ -2687,8 +2687,10 @@
+ strcat(buf, "/"); /* checked */
+ strcat(buf, typebuf); /* checked */
+ fctx->info = isc_mem_strdup(res->mctx, buf);
+- if (fctx->info == NULL)
++ if (fctx->info == NULL) {
++ result = ISC_R_NOMEMORY;
+ goto cleanup_fetch;
++ }
+ FCTXTRACE("create");
+ dns_name_init(&fctx->name, NULL);
+ result = dns_name_dup(name, res->mctx, &fctx->name);
diff --git a/dns/bind95/files/patch-lib_dns_resolver.c b/dns/bind95/files/patch-lib_dns_resolver.c
new file mode 100644
index 000000000000..5605bb71f3ec
--- /dev/null
+++ b/dns/bind95/files/patch-lib_dns_resolver.c
@@ -0,0 +1,23 @@
+--- lib/dns/resolver.c.orig Tue Feb 8 15:59:44 2005
++++ lib/dns/resolver.c Wed Aug 17 02:42:48 2005
+@@ -2665,7 +2665,7 @@
+ unsigned int options, unsigned int bucketnum, fetchctx_t **fctxp)
+ {
+ fetchctx_t *fctx;
+- isc_result_t result = ISC_R_SUCCESS;
++ isc_result_t result;
+ isc_result_t iresult;
+ isc_interval_t interval;
+ dns_fixedname_t qdomain;
+@@ -2687,8 +2687,10 @@
+ strcat(buf, "/"); /* checked */
+ strcat(buf, typebuf); /* checked */
+ fctx->info = isc_mem_strdup(res->mctx, buf);
+- if (fctx->info == NULL)
++ if (fctx->info == NULL) {
++ result = ISC_R_NOMEMORY;
+ goto cleanup_fetch;
++ }
+ FCTXTRACE("create");
+ dns_name_init(&fctx->name, NULL);
+ result = dns_name_dup(name, res->mctx, &fctx->name);
diff --git a/dns/bind96/files/patch-lib_dns_resolver.c b/dns/bind96/files/patch-lib_dns_resolver.c
new file mode 100644
index 000000000000..5605bb71f3ec
--- /dev/null
+++ b/dns/bind96/files/patch-lib_dns_resolver.c
@@ -0,0 +1,23 @@
+--- lib/dns/resolver.c.orig Tue Feb 8 15:59:44 2005
++++ lib/dns/resolver.c Wed Aug 17 02:42:48 2005
+@@ -2665,7 +2665,7 @@
+ unsigned int options, unsigned int bucketnum, fetchctx_t **fctxp)
+ {
+ fetchctx_t *fctx;
+- isc_result_t result = ISC_R_SUCCESS;
++ isc_result_t result;
+ isc_result_t iresult;
+ isc_interval_t interval;
+ dns_fixedname_t qdomain;
+@@ -2687,8 +2687,10 @@
+ strcat(buf, "/"); /* checked */
+ strcat(buf, typebuf); /* checked */
+ fctx->info = isc_mem_strdup(res->mctx, buf);
+- if (fctx->info == NULL)
++ if (fctx->info == NULL) {
++ result = ISC_R_NOMEMORY;
+ goto cleanup_fetch;
++ }
+ FCTXTRACE("create");
+ dns_name_init(&fctx->name, NULL);
+ result = dns_name_dup(name, res->mctx, &fctx->name);