From owner-freebsd-security@FreeBSD.ORG Fri Jul 18 20:49:33 2014 Return-Path: Delivered-To: freebsd-security@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FE6EE09 for ; Fri, 18 Jul 2014 20:49:33 +0000 (UTC) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 037532D5F for ; Fri, 18 Jul 2014 20:49:32 +0000 (UTC) Received: by mail-la0-f41.google.com with SMTP id s18so3270707lam.14 for ; Fri, 18 Jul 2014 13:49:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=7YHzVZw5W5WKQB67ce/+4IAQAHPfnYRvgVWXwCJtnq8=; b=AcfJlfrzPijvlsNRRAw8jLPFyvi/RT/f5PlJe8zhI1aoUPqLcMtkfZfmtoMq88TNzy XXx93mFN+GWq5RfuJxMUepVP5qgFkNSmbvbeSqW5+/t/aG4Iop25oOIusQvJKAQIqWC5 uR6KCZOi7CgEO9qyO+ArBdTzbiWMuQHH+jYFAg41BeAkyU+8QFGmME3ywjYPVGBvc5FN lNfEbuVRURDYTbEJQC8TlUjOIKFT25RcNuRdENbNLAJEG33rIjD+l0lPe/TunBVRcPlD dh/JqOyLDvRG41Rvb20ICf7IGHcOvajtN+QMjyKSaOFrJDxPNOmc3d6BojhLAeCoDYIU 7ARA== X-Gm-Message-State: ALoCoQkbKTsNCXZwvYk+qd2iefzuG/PtGGib/WnwvTw9Tw2VLmSzhKrGyuN0YVFturX1EcpVV1jW X-Received: by 10.112.30.99 with SMTP id r3mr7973040lbh.14.1405716570940; Fri, 18 Jul 2014 13:49:30 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id xk7sm5272756lac.10.2014.07.18.13.49.30 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Jul 2014 13:49:30 -0700 (PDT) Message-ID: <53C98857.8060603@freebsd.org> Date: Sat, 19 Jul 2014 00:49:27 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Steven Chamberlain , Leif Pedersen Subject: Re: Speed and security of /dev/urandom References: <53C85F42.1000704@pyro.eu.org> <4E23BEEA-693A-4FA3-BE94-9BB82B49503A@vpnc.org> <53C97E47.4030100@pyro.eu.org> In-Reply-To: <53C97E47.4030100@pyro.eu.org> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: "freebsd-security@freebsd.org" X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Security issues \[members-only posting\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 20:49:33 -0000 On 19.07.2014 0:06, Steven Chamberlain wrote: > It's been pointed out to me that OpenBSD solved that particular issue > with MAP_INHERIT_ZERO: the state of the arc4random PRNG is zeroed out > on forking, and it knows to reseed then. > > FreeBSD since r227520 (2011-11-15), calls getpid() on every > arc4random_buf call, to see if the pid has changed since it seeded, and > thus reseed. It was shown recently (in the context of LibreSSL > Portable) that this may not work in a contrived corner-case, so there > they added an atfork handler, but again might not always be called. I always say that calling getpid on every arc4random call is ugly and should be replaced by something. pthread_atfork belong to another library and MAP_INHERIT_ZERO is not currently implemented. -- http://ache.vniz.net/