update to unbound 1.4.15, from Brad, OK jakob@

This commit is contained in:
sthen 2012-01-26 22:04:03 +00:00
parent 441a463737
commit b76a65403d
8 changed files with 14 additions and 202 deletions

View File

@ -1,9 +1,8 @@
# $OpenBSD: Makefile,v 1.37 2012/01/10 22:15:54 sthen Exp $
# $OpenBSD: Makefile,v 1.38 2012/01/26 22:04:03 sthen Exp $
COMMENT= validating DNS resolver
DISTNAME= unbound-1.4.14
REVISION= 2
DISTNAME= unbound-1.4.15
CATEGORIES= net
MASTER_SITES= http://www.unbound.net/downloads/
@ -23,10 +22,10 @@ AUTOCONF_VERSION= 2.68
USE_LIBTOOL= Yes
NO_REGRESS= Yes
SHARED_LIBS+= unbound 3.1
SHARED_LIBS+= unbound 3.2
WANTLIB= c crypto event expat ldns>=4.9 ssl
LIB_DEPENDS+= net/ldns/libldns>=1.6.11
WANTLIB= c crypto event expat ldns>=4.10 ssl
LIB_DEPENDS+= net/ldns/libldns>=1.6.12
CONFIGURE_ARGS+= --enable-allsymbols \
--with-ssl=/usr \

View File

@ -1,5 +1,5 @@
MD5 (unbound-1.4.14.tar.gz) = zWn9qqavAeoLb7xZgC90ug==
RMD160 (unbound-1.4.14.tar.gz) = E2r/mBLuus5zwmtgj2QRvQSCFcw=
SHA1 (unbound-1.4.14.tar.gz) = FDUCmr5j0BBiE6y58XO4hRg88dc=
SHA256 (unbound-1.4.14.tar.gz) = wVuFFF4xdfPZM4NwcbT/qujaSjlBOawOfz3+4RcS59M=
SIZE (unbound-1.4.14.tar.gz) = 3546634
MD5 (unbound-1.4.15.tar.gz) = mRc6ZUjg4uyb+sel0CX3ng==
RMD160 (unbound-1.4.15.tar.gz) = 72XoLtXbYcFaMQpg3HrKF68T2Hg=
SHA1 (unbound-1.4.15.tar.gz) = u9pGZk6oORynmGMAzpinl4fA4yI=
SHA256 (unbound-1.4.15.tar.gz) = cp1CfADBYN5O5mlF12KzKCZ36VdAdFAVIIg2khajACA=
SIZE (unbound-1.4.15.tar.gz) = 3562742

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-configure_ac,v 1.1 2011/12/20 10:49:19 sthen Exp $
--- configure.ac.orig Tue Dec 13 03:58:12 2011
+++ configure.ac Tue Dec 13 07:37:19 2011
@@ -204,8 +204,6 @@ AC_DEFINE_UNQUOTED(RSRC_PACKAGE_VERSION, [$wnvs], [ver
$OpenBSD: patch-configure_ac,v 1.2 2012/01/26 22:04:03 sthen Exp $
--- configure.ac.orig Thu Jan 12 08:52:38 2012
+++ configure.ac Thu Jan 26 05:11:48 2012
@@ -206,8 +206,6 @@ AC_DEFINE_UNQUOTED(RSRC_PACKAGE_VERSION, [$wnvs], [ver
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_LANG_C

View File

@ -1,23 +0,0 @@
$OpenBSD: patch-daemon_daemon_c,v 1.1 2012/01/10 22:15:54 sthen Exp $
Fix to randomize hash function, based on 28c3 congress, reported
by Peter van Dijk.
--- daemon/daemon.c.orig Wed Jan 4 17:07:36 2012
+++ daemon/daemon.c Wed Jan 4 17:07:47 2012
@@ -63,6 +63,7 @@
#include "util/log.h"
#include "util/config_file.h"
#include "util/data/msgreply.h"
+#include "util/storage/lookup3.h"
#include "util/storage/slabhash.h"
#include "services/listen_dnsport.h"
#include "services/cache/rrset.h"
@@ -320,6 +321,7 @@ daemon_create_workers(struct daemon* daemon)
if(!daemon->rand)
fatal_exit("could not init random generator");
}
+ hash_set_raninit(ub_random(daemon->rand));
shufport = (int*)calloc(65536, sizeof(int));
if(!shufport)
fatal_exit("out of memory during daemon init");

View File

@ -1,35 +0,0 @@
$OpenBSD: patch-libunbound_libworker_c,v 1.1 2012/01/10 22:15:54 sthen Exp $
Fix to randomize hash function, based on 28c3 congress, reported
by Peter van Dijk.
--- libunbound/libworker.c.orig Wed Jan 4 17:09:21 2012
+++ libunbound/libworker.c Wed Jan 4 17:09:35 2012
@@ -58,6 +58,7 @@
#include "util/random.h"
#include "util/config_file.h"
#include "util/netevent.h"
+#include "util/storage/lookup3.h"
#include "util/storage/slabhash.h"
#include "util/net_help.h"
#include "util/data/dname.h"
@@ -158,6 +159,19 @@ libworker_setup(struct ub_ctx* ctx, int is_bg)
}
if(!w->is_bg || w->is_bg_thread) {
lock_basic_unlock(&ctx->cfglock);
+ }
+ if(1) {
+ /* primitive lockout for threading: if it overwrites another
+ * thread it is like wiping the cache (which is likely empty
+ * at the start) */
+ /* note we are holding the ctx lock in normal threaded
+ * cases so that is solved properly, it is only for many ctx
+ * in different threads that this may clash */
+ static int done_raninit = 0;
+ if(!done_raninit) {
+ done_raninit = 1;
+ hash_set_raninit(ub_random(w->env->rnd));
+ }
}
seed = 0;

View File

@ -1,27 +0,0 @@
$OpenBSD: patch-services_outside_network_c,v 1.1 2012/01/04 21:41:45 sthen Exp $
- Fix for memory leak (about 20 bytes when a tcp or udp send operation
towards authority servers failed, takes about 50.000 such failures to
leak one Mb, such failures are also usually logged), reported by
Robert Fleischmann.
From r2578 upstream.
--- services/outside_network.c.orig Tue Dec 27 15:24:16 2011
+++ services/outside_network.c Tue Dec 27 15:24:42 2011
@@ -1824,6 +1824,7 @@ outnet_serviced_query(struct outside_network* outnet,
if(!serviced_udp_send(sq, buff)) {
(void)rbtree_delete(outnet->serviced, sq);
free(sq->qbuf);
+ free(sq->zone);
free(sq);
free(cb);
return NULL;
@@ -1832,6 +1833,7 @@ outnet_serviced_query(struct outside_network* outnet,
if(!serviced_tcp_send(sq, buff)) {
(void)rbtree_delete(outnet->serviced, sq);
free(sq->qbuf);
+ free(sq->zone);
free(sq);
free(cb);
return NULL;

View File

@ -1,83 +0,0 @@
$OpenBSD: patch-util_storage_lookup3_c,v 1.1 2012/01/10 22:15:54 sthen Exp $
Fix to randomize hash function, based on 28c3 congress, reported
by Peter van Dijk.
--- util/storage/lookup3.c.orig Wed Jan 4 17:16:34 2012
+++ util/storage/lookup3.c Wed Jan 4 17:16:54 2012
@@ -1,4 +1,5 @@
/*
+ January 2012(Wouter) added randomised initial value, fallout from 28c3.
March 2007(Wouter) adapted from lookup3.c original, add config.h include.
added #ifdef VALGRIND to remove 298,384,660 'unused variable k8' warnings.
added include of lookup3.h to check definitions match declarations.
@@ -52,6 +53,15 @@ on 1 byte), but shoehorning those bytes into integers
# include <endian.h> /* attempt to define endianness */
#endif
+/* random initial value */
+static uint32_t raninit = 0xdeadbeef;
+
+void
+hash_set_raninit(uint32_t v)
+{
+ raninit = v;
+}
+
/*
* My best guess at if you are big-endian or little-endian. This may
* need adjustment.
@@ -187,7 +197,7 @@ uint32_t initval) /* the previous hash,
uint32_t a,b,c;
/* Set up the internal state */
- a = b = c = 0xdeadbeef + (((uint32_t)length)<<2) + initval;
+ a = b = c = raninit + (((uint32_t)length)<<2) + initval;
/*------------------------------------------------- handle most of the key */
while (length > 3)
@@ -234,7 +244,7 @@ uint32_t *pb) /* IN: more seed OUT
uint32_t a,b,c;
/* Set up the internal state */
- a = b = c = 0xdeadbeef + ((uint32_t)(length<<2)) + *pc;
+ a = b = c = raninit + ((uint32_t)(length<<2)) + *pc;
c += *pb;
/*------------------------------------------------- handle most of the key */
@@ -297,7 +307,7 @@ uint32_t hashlittle( const void *key, size_t length, u
union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */
/* Set up the internal state */
- a = b = c = 0xdeadbeef + ((uint32_t)length) + initval;
+ a = b = c = raninit + ((uint32_t)length) + initval;
u.ptr = key;
if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) {
@@ -484,7 +494,7 @@ void hashlittle2(
union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */
/* Set up the internal state */
- a = b = c = 0xdeadbeef + ((uint32_t)length) + *pc;
+ a = b = c = raninit + ((uint32_t)length) + *pc;
c += *pb;
u.ptr = key;
@@ -666,7 +676,7 @@ uint32_t hashbig( const void *key, size_t length, uint
union { const void *ptr; size_t i; } u; /* to cast key to (size_t) happily */
/* Set up the internal state */
- a = b = c = 0xdeadbeef + ((uint32_t)length) + initval;
+ a = b = c = raninit + ((uint32_t)length) + initval;
u.ptr = key;
if (HASH_BIG_ENDIAN && ((u.i & 0x3) == 0)) {
@@ -941,7 +951,7 @@ void driver3()
printf("hashlittle2 and hashlittle mismatch\n");
/* check that hashword2 and hashword produce the same results */
- len = 0xdeadbeef;
+ len = raninit;
i=47, j=0;
hashword2(&len, 1, &i, &j);
if (hashword(&len, 1, 47) != i)

View File

@ -1,19 +0,0 @@
$OpenBSD: patch-util_storage_lookup3_h,v 1.1 2012/01/10 22:15:54 sthen Exp $
Fix to randomize hash function, based on 28c3 congress, reported
by Peter van Dijk.
--- util/storage/lookup3.h.orig Wed Jan 4 17:16:41 2012
+++ util/storage/lookup3.h Wed Jan 4 17:16:56 2012
@@ -61,4 +61,11 @@ uint32_t hashword(const uint32_t *k, size_t length, ui
*/
uint32_t hashlittle(const void *k, size_t length, uint32_t initval);
+/**
+ * Set the randomisation initial value, set this before threads start,
+ * and before hashing stuff (because it changes subsequent results).
+ * @param v: value
+ */
+void hash_set_raninit(uint32_t v);
+
#endif /* UTIL_STORAGE_LOOKUP3_H */