Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Dec 2009 19:00:21 +0300
From:      Paul Graphov <graphov@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: yarrow random generator
Message-ID:  <5a5b03660912240800n2265cd2ci508c64875a8b6d12@mail.gmail.com>
In-Reply-To: <20091224144703.482896eb@gumby.homeunix.com>
References:  <5a5b03660912240445x7df1498dt42e29d93105efebc@mail.gmail.com> <20091224144703.482896eb@gumby.homeunix.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <rwmaillists@googlemail.com>

> On Thu, 24 Dec 2009 15:45:15 +0300
> Paul Graphov <graphov@gmail.com> 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"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5a5b03660912240800n2265cd2ci508c64875a8b6d12>