From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 24 16:07:08 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 898721065693 for ; Thu, 24 Dec 2009 16:07:08 +0000 (UTC) (envelope-from graphov@gmail.com) Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by mx1.freebsd.org (Postfix) with ESMTP id 1FF298FC17 for ; Thu, 24 Dec 2009 16:07:07 +0000 (UTC) Received: by ewy26 with SMTP id 26so4905241ewy.3 for ; Thu, 24 Dec 2009 08:07:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=nAfnWbJGtifOhWficKHCrgMD2+E1mezzhhbQSXOio0s=; b=gbhmKZfjUSvXnn+SFJ6/68guE7zbqH4Q7dIf5SBFjb2we4x50O7C52tWY+ABobHpBV jCezAbHInQu4LJp0XfcOsk1T95DpUeHmNOXq4qCNnrh/G4A879tnBieZ+8FwuzpJmgkF dbDpswUiwKF078KOISsbzn3FzP7zztDl+3pNU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Sr+BpiV1sdrluC8kAEVKZ1qByBR5IUphCCXd1cFMUfV4yOLL7LPRYlIGX+xQ+CZHAS t+3vJlKsZcifBRTi/VYvlvcwTfGBuuxjmCpo4eCspor/HBrs4T/JJHnvc9nikk+pugPB kTOj7Uru4u8et50TGp5a726chFAQTj9FrVbY0= MIME-Version: 1.0 Received: by 10.213.96.6 with SMTP id f6mr7702626ebn.81.1261670421599; Thu, 24 Dec 2009 08:00:21 -0800 (PST) In-Reply-To: <20091224144703.482896eb@gumby.homeunix.com> References: <5a5b03660912240445x7df1498dt42e29d93105efebc@mail.gmail.com> <20091224144703.482896eb@gumby.homeunix.com> Date: Thu, 24 Dec 2009 19:00:21 +0300 Message-ID: <5a5b03660912240800n2265cd2ci508c64875a8b6d12@mail.gmail.com> From: Paul Graphov To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: yarrow random generator X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2009 16:07:08 -0000 random_systat.seeded is exported to sysctl? isn't it? In this case If somebody resets it to zero, some "read" goest to "block" and before acquiring mutex it is reseeded, setting it to true, block will never leave the cycle. 2009/12/24 RW > On Thu, 24 Dec 2009 15:45:15 +0300 > Paul Graphov wrote: > > > Hello guys, > > > > I've looked at FreeBSD 8.0 cryptographically secure pseudorandom > > numbers generator and have a question. It looks like a bug but I'am > > not sure. > > > > In file sys/dev/randomdev.c, function random_read: > > > > if (!random_systat.seeded) > > error = (*random_systat.block)(flag); > > > > It blocks until PRNG is seeded. > > random_systat.seeded is initialized to 1 and it's never set to anything > other than 1 > > I got impression that blocking was something that seemed like a good > idea at the time, but fell-off half-way through coding. It's not a > good idea to block /dev/random, without a separate urandom. > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >