summaryrefslogtreecommitdiff
path: root/net-dns/djbdns
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-05-07 11:18:59 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-05-07 11:18:59 +0100
commita2810985afabcc31d3eace5e61d8ea25b852ba17 (patch)
treed254e77a7aeadd875db2dc73532da78094238ffd /net-dns/djbdns
parenteab5731cdf11d4ae8cdf111461d46fd96c5bdd37 (diff)
gentoo resync : 07.05.2019
Diffstat (limited to 'net-dns/djbdns')
-rw-r--r--net-dns/djbdns/Manifest1
-rw-r--r--net-dns/djbdns/files/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries-ipv6-test25-r1.patch351
2 files changed, 0 insertions, 352 deletions
diff --git a/net-dns/djbdns/Manifest b/net-dns/djbdns/Manifest
index f4288f5b6676..8a08b4f5da35 100644
--- a/net-dns/djbdns/Manifest
+++ b/net-dns/djbdns/Manifest
@@ -1,5 +1,4 @@
AUX 1.05-errno-r1.patch 242 BLAKE2B b02d686bbdad4178de2e8ba822feeeec5a3aa4549119c86ec806bfc34d0bebdcef7ee6bb2f57ffe73dc42e9d96b2bf08a28be7502aa8974f8f96cd32dcece178 SHA512 086d02600034d486f084fd2500aba9041dfa02110781594cdc3781a3ad7823f61f11c54c053c8c1241f58660527abe536906aba0e7f6c49ed3b8dbd74ba8f2b7
-AUX CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries-ipv6-test25-r1.patch 9944 BLAKE2B 05be2d88ff5e8c212370cea199d7e817d07fa9ecb807c567d48b34c963e101c18bd1d785be9d46ee6cbf6f8a84ca53e4dd1432c868d9acecabbb3ffcc326f878 SHA512 6c40018bfe97f9ed2ab1bb4034ceb20089edc93514a4c9931a5e1f09cb6d9a8f221eb9652b3b1485f80df643a1fb1d2c88ff148421e86af7cf7b1485b9c61c30
AUX CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries-ipv6-test28.patch 9954 BLAKE2B ab189b25421c016bd24ecc34d9eae3552eeeb1303d158a2adeeb9c27b48a8935425d76f803104ba0be4bcc1bacd6cac48fb9b800c7401ea306d017525404b0cb SHA512 3ff6e971739bfe7f0fd7defd6520f4a03f88dd907668018c10efd91d03e4dbc2068773953d6feed22308d82fb2d38066b2102c6f6fd738c15c4bee6835a52dce
AUX CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries-r1.patch 9914 BLAKE2B 3224e58eac5ac254359158a193b8a4c7618ff12826cce0f71b7c45e9c886ff54d1fb883d02a6b2d80801f395b721dee46390b6b5191e22cc5f2d75da06f2b08c SHA512 59e9aae2fd8e7c1e4d275066afceaade3b1276c6cda78cd58fef1dfbe9749c9e1bb415a80643b3c50a33372166aec055a9b3a6bcb3ed4cfd77e6e6038e069cff
AUX CVE2008-4392_0002-dnscache-cache-soa-records-ipv6.patch 3043 BLAKE2B 224cf29a7db357c3c421212cc240c16801ea544e1cbad65605e0ba8413139c09d37144f2f784a751015abbb99c2f36e3716c28a821b8f66edf02310c72d28417 SHA512 f830bfd2fabd4d9b4e2649bcc4061d656d4645b93829415d070b26c6a22e8e17d941666b8e776947bf9a8ef93007f77d8be57fc9911dcc6dc2b7ac607d556ba0
diff --git a/net-dns/djbdns/files/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries-ipv6-test25-r1.patch b/net-dns/djbdns/files/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries-ipv6-test25-r1.patch
deleted file mode 100644
index 1d132d6d4f5e..000000000000
--- a/net-dns/djbdns/files/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries-ipv6-test25-r1.patch
+++ /dev/null
@@ -1,351 +0,0 @@
-diff --git a/Makefile b/Makefile
-index 5ccd647..eee09dd 100644
---- a/Makefile
-+++ b/Makefile
-@@ -346,11 +346,11 @@ stralloc.h iopause.h taia.h tai.h uint64.h taia.h
- ./compile dns_txt.c
-
- dnscache: \
--load dnscache.o droproot.o okclient.o log.o cache.o query.o \
-+load dnscache.o droproot.o okclient.o log.o cache.o query.o qmerge.o \
- response.o dd.o roots.o iopause.o prot.o dns.a env.a alloc.a buffer.a \
- libtai.a unix.a byte.a socket.lib
- ./load dnscache droproot.o okclient.o log.o cache.o \
-- query.o response.o dd.o roots.o iopause.o prot.o dns.a \
-+ query.o qmerge.o response.o dd.o roots.o iopause.o prot.o dns.a \
- env.a alloc.a buffer.a libtai.a unix.a byte.a `cat \
- socket.lib`
-
-@@ -371,7 +371,7 @@ compile dnscache.c env.h exit.h scan.h strerr.h error.h ip4.h \
- uint16.h uint64.h socket.h uint16.h dns.h stralloc.h gen_alloc.h \
- iopause.h taia.h tai.h uint64.h taia.h taia.h byte.h roots.h fmt.h \
- iopause.h query.h dns.h uint32.h alloc.h response.h uint32.h cache.h \
--uint32.h uint64.h ndelay.h log.h uint64.h okclient.h droproot.h
-+uint32.h uint64.h ndelay.h log.h uint64.h okclient.h droproot.h maxclient.h
- ./compile dnscache.c
-
- dnsfilter: \
-@@ -749,11 +749,16 @@ qlog.o: \
- compile qlog.c buffer.h qlog.h uint16.h
- ./compile qlog.c
-
-+qmerge.o: \
-+compile qmerge.c qmerge.h dns.h stralloc.h gen_alloc.h iopause.h \
-+taia.h tai.h uint64.h log.h maxclient.h
-+ ./compile qmerge.c
-+
- query.o: \
- compile query.c error.h roots.h log.h uint64.h case.h cache.h \
- uint32.h uint64.h byte.h dns.h stralloc.h gen_alloc.h iopause.h \
- taia.h tai.h uint64.h taia.h uint64.h uint32.h uint16.h dd.h alloc.h \
--response.h uint32.h query.h dns.h uint32.h
-+response.h uint32.h query.h dns.h uint32.h qmerge.h
- ./compile query.c
-
- random-ip: \
-diff --git a/dnscache.c b/dnscache.c
-index abcba69..c84e4b8 100644
---- a/dnscache.c
-+++ b/dnscache.c
-@@ -23,6 +23,7 @@
- #include "log.h"
- #include "okclient.h"
- #include "droproot.h"
-+#include "maxclient.h"
-
- long interface;
-
-@@ -59,7 +60,6 @@ uint64 numqueries = 0;
-
- static int udp53;
-
--#define MAXUDP 200
- static struct udpclient {
- struct query q;
- struct taia start;
-@@ -136,7 +136,6 @@ void u_new(void)
-
- static int tcp53;
-
--#define MAXTCP 20
- struct tcpclient {
- struct query q;
- struct taia start;
-diff --git a/log.c b/log.c
-index df465e2..1b0d98c 100644
---- a/log.c
-+++ b/log.c
-@@ -149,6 +149,13 @@ void log_tx(const char *q,const char qtype[2],const char *control,const char ser
- line();
- }
-
-+void log_tx_piggyback(const char *q, const char qtype[2], const char *control)
-+{
-+ string("txpb ");
-+ logtype(qtype); space(); name(q); space(); name(control);
-+ line();
-+}
-+
- void log_cachedanswer(const char *q,const char type[2])
- {
- string("cached "); logtype(type); space();
-diff --git a/log.h b/log.h
-index fe62fa3..d9a829b 100644
---- a/log.h
-+++ b/log.h
-@@ -18,6 +18,7 @@ extern void log_cachednxdomain(const char *);
- extern void log_cachedns(const char *,const char *);
-
- extern void log_tx(const char *,const char *,const char *,const char *,unsigned int);
-+extern void log_tx_piggyback(const char *,const char *,const char *);
-
- extern void log_nxdomain(const char *,const char *,unsigned int);
- extern void log_nodata(const char *,const char *,const char *,unsigned int);
-diff --git a/maxclient.h b/maxclient.h
-new file mode 100644
-index 0000000..e52fcd1
---- /dev/null
-+++ b/maxclient.h
-@@ -0,0 +1,7 @@
-+#ifndef MAXCLIENT_H
-+#define MAXCLIENT_H
-+
-+#define MAXUDP 200
-+#define MAXTCP 20
-+
-+#endif /* MAXCLIENT_H */
-diff --git a/qmerge.c b/qmerge.c
-new file mode 100644
-index 0000000..7c92299
---- /dev/null
-+++ b/qmerge.c
-@@ -0,0 +1,115 @@
-+#include "qmerge.h"
-+#include "byte.h"
-+#include "log.h"
-+#include "maxclient.h"
-+
-+#define QMERGE_MAX (MAXUDP+MAXTCP)
-+struct qmerge inprogress[QMERGE_MAX];
-+
-+static
-+int qmerge_key_init(struct qmerge_key *qmk, const char *q, const char qtype[2],
-+ const char *control)
-+{
-+ if (!dns_domain_copy(&qmk->q, q)) return 0;
-+ byte_copy(qmk->qtype, 2, qtype);
-+ if (!dns_domain_copy(&qmk->control, control)) return 0;
-+ return 1;
-+}
-+
-+static
-+int qmerge_key_equal(struct qmerge_key *a, struct qmerge_key *b)
-+{
-+ return
-+ byte_equal(a->qtype, 2, b->qtype) &&
-+ dns_domain_equal(a->q, b->q) &&
-+ dns_domain_equal(a->control, b->control);
-+}
-+
-+static
-+void qmerge_key_free(struct qmerge_key *qmk)
-+{
-+ dns_domain_free(&qmk->q);
-+ dns_domain_free(&qmk->control);
-+}
-+
-+void qmerge_free(struct qmerge **x)
-+{
-+ struct qmerge *qm;
-+
-+ qm = *x;
-+ *x = 0;
-+ if (!qm || !qm->active) return;
-+
-+ qm->active--;
-+ if (!qm->active) {
-+ qmerge_key_free(&qm->key);
-+ dns_transmit_free(&qm->dt);
-+ }
-+}
-+
-+int qmerge_start(struct qmerge **qm, const char servers[64], int flagrecursive,
-+ const char *q, const char qtype[2], const char localip[4],
-+ const char *control)
-+{
-+ struct qmerge_key k;
-+ int i;
-+ int r;
-+
-+ qmerge_free(qm);
-+
-+ byte_zero(&k, sizeof k);
-+ if (!qmerge_key_init(&k, q, qtype, control)) return -1;
-+ for (i = 0; i < QMERGE_MAX; i++) {
-+ if (!inprogress[i].active) continue;
-+ if (!qmerge_key_equal(&k, &inprogress[i].key)) continue;
-+ log_tx_piggyback(q, qtype, control);
-+ inprogress[i].active++;
-+ *qm = &inprogress[i];
-+ qmerge_key_free(&k);
-+ return 0;
-+ }
-+
-+ for (i = 0; i < QMERGE_MAX; i++)
-+ if (!inprogress[i].active)
-+ break;
-+ if (i == QMERGE_MAX) return -1;
-+
-+ log_tx(q, qtype, control, servers, 0);
-+ r = dns_transmit_start(&inprogress[i].dt, servers, flagrecursive, q, qtype, localip);
-+ if (r == -1) { qmerge_key_free(&k); return -1; }
-+ inprogress[i].active++;
-+ inprogress[i].state = 0;
-+ qmerge_key_free(&inprogress[i].key);
-+ byte_copy(&inprogress[i].key, sizeof k, &k);
-+ *qm = &inprogress[i];
-+ return 0;
-+}
-+
-+void qmerge_io(struct qmerge *qm, iopause_fd *io, struct taia *deadline)
-+{
-+ if (qm->state == 0) {
-+ dns_transmit_io(&qm->dt, io, deadline);
-+ qm->state = 1;
-+ }
-+ else {
-+ io->fd = -1;
-+ io->events = 0;
-+ }
-+}
-+
-+int qmerge_get(struct qmerge **x, const iopause_fd *io, const struct taia *when)
-+{
-+ int r;
-+ struct qmerge *qm;
-+
-+ qm = *x;
-+ if (qm->state == -1) return -1; /* previous error */
-+ if (qm->state == 0) return 0; /* no packet */
-+ if (qm->state == 2) return 1; /* already got packet */
-+
-+ r = dns_transmit_get(&qm->dt, io, when);
-+ if (r == -1) { qm->state = -1; return -1; } /* error */
-+ if (r == 0) { qm->state = 0; return 0; } /* must wait for i/o */
-+ if (r == 1) { qm->state = 2; return 1; } /* got packet */
-+ return -1; /* bug */
-+}
-diff --git a/qmerge.h b/qmerge.h
-new file mode 100644
-index 0000000..9a58157
---- /dev/null
-+++ b/qmerge.h
-@@ -0,0 +1,24 @@
-+#ifndef QMERGE_H
-+#define QMERGE_H
-+
-+#include "dns.h"
-+
-+struct qmerge_key {
-+ char *q;
-+ char qtype[2];
-+ char *control;
-+};
-+
-+struct qmerge {
-+ int active;
-+ struct qmerge_key key;
-+ struct dns_transmit dt;
-+ int state; /* -1 = error, 0 = need io, 1 = need get, 2 = got packet */
-+};
-+
-+extern int qmerge_start(struct qmerge **,const char *,int,const char *,const char *,const char *,const char *);
-+extern void qmerge_io(struct qmerge *,iopause_fd *,struct taia *);
-+extern int qmerge_get(struct qmerge **,const iopause_fd *,const struct taia *);
-+extern void qmerge_free(struct qmerge **);
-+
-+#endif /* QMERGE_H */
-diff --git a/query.c b/query.c
-index d61b20c..d9be8b8 100644
---- a/query.c
-+++ b/query.c
-@@ -84,7 +84,7 @@ static void cleanup(struct query *z)
- int j;
- int k;
-
-- dns_transmit_free(&z->dt);
-+ qmerge_free(&z->qm);
- for (j = 0;j < QUERY_MAXALIAS;++j)
- dns_domain_free(&z->alias[j]);
- for (j = 0;j < QUERY_MAXLEVEL;++j) {
-@@ -624,15 +624,9 @@ static int doit(struct query *z,int state)
- if (j == 256) goto SERVFAIL;
-
- dns_sortip6(z->servers[z->level],256);
-- if (z->level) {
-- dtype = z->ipv6[z->level] ? DNS_T_AAAA : DNS_T_A;
-- log_tx(z->name[z->level],dtype,z->control[z->level],z->servers[z->level],z->level);
-- if (dns_transmit_start(&z->dt,z->servers[z->level],flagforwardonly,z->name[z->level],dtype,z->localip) == -1) goto DIE;
-- }
-- else {
-- log_tx(z->name[0],z->type,z->control[0],z->servers[0],0);
-- if (dns_transmit_start(&z->dt,z->servers[0],flagforwardonly,z->name[0],z->type,z->localip) == -1) goto DIE;
-- }
-+ dtype = z->level ? (z->ipv6[z->level] ? DNS_T_AAAA : DNS_T_A) : z->type;
-+ if (qmerge_start(&z->qm,z->servers[z->level],flagforwardonly,z->name[z->level],dtype,z->localip,z->control[z->level]) == -1) goto DIE;
-+
- return 0;
-
-
-@@ -646,10 +640,10 @@ static int doit(struct query *z,int state)
-
- HAVEPACKET:
- if (++z->loop == 200) goto DIE;
-- buf = z->dt.packet;
-- len = z->dt.packetlen;
-+ buf = z->qm->dt.packet;
-+ len = z->qm->dt.packetlen;
-
-- whichserver = z->dt.servers + 16 * z->dt.curserver;
-+ whichserver = z->qm->dt.servers + 16 * z->qm->dt.curserver;
- control = z->control[z->level];
- d = z->name[z->level];
- /* dtype = z->level ? DNS_T_A : z->type; */
-@@ -1071,7 +1065,7 @@ int query_start(struct query *z,char *dn,char type[2],char class[2],char localip
-
- int query_get(struct query *z,iopause_fd *x,struct taia *stamp)
- {
-- switch(dns_transmit_get(&z->dt,x,stamp)) {
-+ switch(qmerge_get(&z->qm,x,stamp)) {
- case 1:
- return doit(z,1);
- case -1:
-@@ -1082,5 +1076,5 @@ int query_get(struct query *z,iopause_fd *x,struct taia *stamp)
-
- void query_io(struct query *z,iopause_fd *x,struct taia *deadline)
- {
-- dns_transmit_io(&z->dt,x,deadline);
-+ qmerge_io(z->qm,x,deadline);
- }
-diff --git a/query.h b/query.h
-index 61812aa..93a322e 100644
---- a/query.h
-+++ b/query.h
-@@ -1,7 +1,7 @@
- #ifndef QUERY_H
- #define QUERY_H
-
--#include "dns.h"
-+#include "qmerge.h"
- #include "uint32.h"
-
- #define QUERY_MAXLEVEL 5
-@@ -22,7 +22,7 @@ struct query {
- uint32 scope_id;
- char type[2];
- char class[2];
-- struct dns_transmit dt;
-+ struct qmerge *qm;
- } ;
-
- extern int query_start(struct query *,char *,char *,char *,char *,unsigned int);