From owner-svn-src-all@FreeBSD.ORG Wed Jul 31 01:58:48 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 06739DC4 for ; Wed, 31 Jul 2013 01:58:48 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com [209.85.215.52]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7DF7823E4 for ; Wed, 31 Jul 2013 01:58:46 +0000 (UTC) Received: by mail-la0-f52.google.com with SMTP id fq13so84484lab.25 for ; Tue, 30 Jul 2013 18:58:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:openpgp:content-type :content-transfer-encoding:x-gm-message-state; bh=w47n9+4LrT+1w5tNPGSM6lsj+Z+QeoodjmUCLAWVe0s=; b=Z6tuDFQzwFwsg3p+9p4q8KWOHK+vSvo/HMcQ0EI4lmiWDYX2uu0ahVkOK2cw4hvDic 0kxCff/GQ89b8eRPjC67F30REKhcuucCVJjhNOgnjudBkmturkLHt32D7AgJtiGMSnBq DxRqJiocMIBwbaiOcIWFvxth/uZVSn2DXg6t0+WmgPqYl/iCi7leLPoHnh01AZbhYNCp Nd0VjZ4csk1nwJiJ8ypnDowI3TGrA31LvXRrw/l4eLoGg+vobX3Q+O6j7QuAmIFh3Bip QQwJgdakY+jE6LMczFETILacpx/go9xiSZgbS5l1iw620W+sbTjkUsDC+rrpBEG27+6D n2Fg== X-Received: by 10.112.5.199 with SMTP id u7mr28951057lbu.67.1375235925240; Tue, 30 Jul 2013 18:58:45 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id gh5sm286942lbc.12.2013.07.30.18.58.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Jul 2013 18:58:44 -0700 (PDT) Message-ID: <51F86F53.9020600@freebsd.org> Date: Wed, 31 Jul 2013 05:58:43 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: obrien@freebsd.org Subject: Re: svn commit: r253786 - in head/sys: dev/random modules/padlock_rng modules/rdrand_rng modules/yarrow_rng References: <201307292058.r6TKwA56031193@svn.freebsd.org> <51F6E0AB.3010001@freebsd.org> <20130731000746.GA65806@dragon.NUXI.org> In-Reply-To: <20130731000746.GA65806@dragon.NUXI.org> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQm0Edd9yGRXMs98GGYEomzymTIR5nqi9eAcw41qXwHjJ5SdPfIS3lgeyzQi/hqmO51kM+bR Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2013 01:58:48 -0000 On 31.07.2013 4:07, David O'Brien wrote: > I believe you're talking about this code in > sys/libkern/arc4random.c:arc4rand() > > if (atomic_cmpset_int(&arc4rand_iniseed_state, ARC4_ENTR_HAVE, > ARC4_ENTR_SEED) || reseed || > (arc4_numruns > ARC4_RESEED_BYTES) || > (tv.tv_sec > arc4_t_reseed)) > arc4_randomstir(); > > Without setting 'arc4rand_iniseed_state' from ARC4_ENTR_NONE -> > ARC4_ENTR_HAVE, we would still call arc4_randomstir() periodically due > to (tv.tv_sec > arc4_t_reseed) and (arc4_numruns > ARC4_RESEED_BYTES). The whole problem is that arc4 is poorly initialized right after boot, but immediately used in many places like tcp. It reseeds again only after 5 minutes after boot making vulnerability window at this interval. > But, this situation isn't the big issue. We have an existing bug where > if one is using a hardware RNG, read_random() never gets changed from > simply being read_random_phony() due to random_modevent() not calling > random_yarrow_init_harvester() thru '(*random_systat->init)()'. Thus > arc4random() has been weak for thus using the Intel RDRAND or Via > Padlock. I don't fix hardware RNG parts due to missing hardware for tests. They should have the same line as randomdev_soft.c somewhere. -- http://ache.vniz.net/ bitcoin:1G6ugdNY6e5jx1GVnAU2ntj2NEfmjKG85r