[unbound/f21] Fix race condition in arc4random (#1166878)

Tomas Hozza thozza at fedoraproject.org
Wed Nov 26 13:22:37 UTC 2014


commit 3249758581ccafcad14408478a5ebdb7394de258
Author: Tomas Hozza <thozza at redhat.com>
Date:   Wed Nov 26 14:20:31 2014 +0100

    Fix race condition in arc4random (#1166878)
    
    Signed-off-by: Tomas Hozza <thozza at redhat.com>

 unbound-1.5.0-arc4random-race-condition.patch |   30 +++++++++++++++++++++++++
 unbound.spec                                  |    9 ++++++-
 2 files changed, 38 insertions(+), 1 deletions(-)
---
diff --git a/unbound-1.5.0-arc4random-race-condition.patch b/unbound-1.5.0-arc4random-race-condition.patch
new file mode 100644
index 0000000..7f52ddc
--- /dev/null
+++ b/unbound-1.5.0-arc4random-race-condition.patch
@@ -0,0 +1,30 @@
+From b4200f7e7ac1ca4a315df84e92cd31d8ba423cee Mon Sep 17 00:00:00 2001
+From: wouter <wouter at be551aaa-1e26-0410-a405-d3ace91eadb9>
+Date: Fri, 21 Nov 2014 08:22:18 +0000
+Subject: [PATCH] - Fix crash on multiple thread random usage on systems
+ without   arc4random.
+
+git-svn-id: http://unbound.nlnetlabs.nl/svn/trunk@3277 be551aaa-1e26-0410-a405-d3ace91eadb9
+---
+ compat/arc4_lock.c | 4 +++-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/compat/arc4_lock.c b/compat/arc4_lock.c
+index ce8bb41..faa743d 100644
+--- a/compat/arc4_lock.c
++++ b/compat/arc4_lock.c
+@@ -53,8 +53,10 @@ static int arc4lockinit = 0;
+ 
+ void _ARC4_LOCK(void)
+ {
+-	if(!arc4lockinit)
++	if(!arc4lockinit) {
++		arc4lockinit = 1;
+ 		lock_quick_init(&arc4lock);
++	}
+ 	lock_quick_lock(&arc4lock);
+ }
+ 
+-- 
+1.9.3
+
diff --git a/unbound.spec b/unbound.spec
index 5393a79..44c628e 100644
--- a/unbound.spec
+++ b/unbound.spec
@@ -19,7 +19,7 @@
 Summary: Validating, recursive, and caching DNS(SEC) resolver
 Name: unbound
 Version: 1.5.0
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: BSD
 Url: http://www.nlnetlabs.nl/unbound/
 Source: http://www.unbound.net/downloads/%{name}-%{version}.tar.gz
@@ -41,6 +41,8 @@ Source14: unbound.sysconfig
 Source15: unbound.cron
 Source16: unbound-munin.README
 
+Patch0: unbound-1.5.0-arc4random-race-condition.patch
+
 Group: System Environment/Daemons
 BuildRequires: flex, openssl-devel
 BuildRequires: libevent-devel expat-devel
@@ -113,6 +115,8 @@ Python modules and extensions for unbound
 
 %prep
 %setup -q 
+%patch0 -p1 -b .arc4random_fix
+
 
 %build
 # This is needed to rebuild the configure script to support Python 3.x
@@ -290,6 +294,9 @@ exit 0
 /bin/systemctl try-restart unbound-keygen.service >/dev/null 2>&1 || :
 
 %changelog
+* Wed Nov 26 2014 Tomas Hozza <thozza at redhat.com> - 1.5.0-2
+- Fix race condition in arc4random (#1166878)
+
 * Wed Nov 19 2014 Tomas Hozza <thozza at redhat.com> - 1.5.0-1
 - update to 1.5.0
 


More information about the scm-commits mailing list