Andrey Chernov writes:
On Thu, Jan 26, 2012 at 10:13:41PM +0400, Andrey Chernov wrote:
On Thu, Jan 26, 2012 at 12:52:43PM -0500, David Schultz wrote:
Why complicate things with atomics at all? A race might result in
arc4random(9) being seeded multiple times, but that's harmless.
On Mon, Jan 30, 2012 at 11:30:15AM +, Mark Murray wrote:
Well, I almost forget about my special case: I have personal prohibition
from @secteam (5 years old already) to commit anything to all RNG areas.
So, the question is: could anyone of you commit some version from this
thread,
On Thu, Jan 26, 2012 at 10:13:41PM +0400, Andrey Chernov wrote:
On Thu, Jan 26, 2012 at 12:52:43PM -0500, David Schultz wrote:
Why complicate things with atomics at all? A race might result in
arc4random(9) being seeded multiple times, but that's harmless.
Multiply seeding in line is
On Sat, Jan 28, 2012 at 06:47:50PM +1100, Bruce Evans wrote:
--- sys/libkern.h.old 2012-01-16 07:15:12.0 +0400
+++ sys/libkern.h 2012-01-28 08:49:19.0 +0400
@@ -70,6 +70,11 @@ static __inline int abs(int a) { return
static __inline long labs(long a) { return (a 0 ?
On Thu, 26 Jan 2012, Andrey Chernov wrote:
On Thu, Jan 26, 2012 at 11:32:38AM -0500, John Baldwin wrote:
Atomics don't operate on enums. You'll need to make it an int and just use
#define's for the 3 states.
This restores some style bugs and keeps old ones.
--- sys/libkern.h.old
On Fri, Jan 27, 2012 at 08:34:35PM +1100, Bruce Evans wrote:
On Thu, 26 Jan 2012, Andrey Chernov wrote:
On Thu, Jan 26, 2012 at 11:32:38AM -0500, John Baldwin wrote:
Atomics don't operate on enums. You'll need to make it an int and just
use
#define's for the 3 states.
This restores
New verson addressed bde's style things:
--- sys/libkern.h.old 2012-01-16 07:15:12.0 +0400
+++ sys/libkern.h 2012-01-28 08:49:19.0 +0400
@@ -70,6 +70,11 @@ static __inline int abs(int a) { return
static __inline long labs(long a) { return (a 0 ? -a : a); }
static
On Sat, 28 Jan 2012, Andrey Chernov wrote:
New verson addressed bde's style things:
Thanks, but ...
--- sys/libkern.h.old 2012-01-16 07:15:12.0 +0400
+++ sys/libkern.h 2012-01-28 08:49:19.0 +0400
@@ -70,6 +70,11 @@ static __inline int abs(int a) { return
static
On Wednesday, January 25, 2012 10:39:50 pm Andrey Chernov wrote:
On Thu, Jan 26, 2012 at 07:03:05AM +0400, Andrey Chernov wrote:
On Wed, Jan 25, 2012 at 07:16:41PM +, Mark Murray wrote:
I thought you were going to do this as a function? It would be
slightly neater to do it that way.
On Thu, Jan 26, 2012 at 08:39:07AM -0500, John Baldwin wrote:
What is the purpose of the atomics? Doing atomic_load/atomic_store
is just as racy as if you had not used atomics at all.
Thanx for a hint.
Protecting comparison itself isn't essential as protecting variable
consitency because
On Thu, Jan 26, 2012 at 08:39:07AM -0500, John Baldwin wrote:
atomic_cmpset_int(iniseed_state, ARC4_ENTER_NONE,
ARC4_ENTER_HAVE);
break;
Updated version (I hope, final):
--- sys/libkern.h.old 2012-01-16 07:15:12.0 +0400
+++ sys/libkern.h 2012-01-26
On Thursday, January 26, 2012 10:56:27 am Andrey Chernov wrote:
On Thu, Jan 26, 2012 at 08:39:07AM -0500, John Baldwin wrote:
atomic_cmpset_int(iniseed_state, ARC4_ENTER_NONE,
ARC4_ENTER_HAVE);
break;
Updated version (I hope, final):
--- sys/libkern.h.old
On Thu, Jan 26, 2012 at 11:32:38AM -0500, John Baldwin wrote:
On Thursday, January 26, 2012 10:56:27 am Andrey Chernov wrote:
On Thu, Jan 26, 2012 at 08:39:07AM -0500, John Baldwin wrote:
atomic_cmpset_int(iniseed_state, ARC4_ENTER_NONE,
ARC4_ENTER_HAVE);
On Thu, Jan 26, 2012 at 11:32:38AM -0500, John Baldwin wrote:
Atomics don't operate on enums. You'll need to make it an int and just use
#define's for the 3 states.
--- sys/libkern.h.old 2012-01-16 07:15:12.0 +0400
+++ sys/libkern.h 2012-01-26 21:40:21.0 +0400
@@
On Thu, Jan 26, 2012, Andrey Chernov wrote:
On Thu, Jan 26, 2012 at 11:32:38AM -0500, John Baldwin wrote:
On Thursday, January 26, 2012 10:56:27 am Andrey Chernov wrote:
On Thu, Jan 26, 2012 at 08:39:07AM -0500, John Baldwin wrote:
atomic_cmpset_int(iniseed_state,
On Thu, Jan 26, 2012 at 11:32:38AM -0500, John Baldwin wrote:
On Thursday, January 26, 2012 10:56:27 am Andrey Chernov wrote:
On Thu, Jan 26, 2012 at 08:39:07AM -0500, John Baldwin wrote:
atomic_cmpset_int(iniseed_state, ARC4_ENTER_NONE,
ARC4_ENTER_HAVE);
On Thu, Jan 26, 2012 at 06:34:13PM +0100, Stefan Farfeleder wrote:
The type of an enumerator actually is `int', so it should be fine.
Please ignore that, I misread the diff.
Stefan
___
svn-src-head@freebsd.org mailing list
On Thu, Jan 26, 2012 at 12:52:43PM -0500, David Schultz wrote:
Why complicate things with atomics at all? A race might result in
arc4random(9) being seeded multiple times, but that's harmless.
Multiply seeding in line is harmless, just waste of time and resources.
Other case is one missing
David Schultz writes:
Although current version with current kernel flags works, I forget
it is implementation defined in general and not always equal to
sizeof(int), f.e. with gcc --short-enums. I'll remade it with
#defines, thanx again.
Why complicate things with atomics at all? A race
On Sun, Jan 22, 2012 at 09:43:02PM +, Mark Murray wrote:
Thanx for review! I'll send final version to this thread a bit
later when I'll find more free time.
Final, unless something else noticed.
--- sys/libkern.h.bak 2012-01-16 07:15:12.0 +0400
+++ sys/libkern.h
On Wed, Jan 25, 2012 at 07:16:41PM +, Mark Murray wrote:
I thought you were going to do this as a function? It would be
slightly neater to do it that way.
Looks good! Are you sure this needs no locking or volatile
variables?
Now with function, volatile, atomic and even enum:
---
On Thu, Jan 26, 2012 at 07:03:05AM +0400, Andrey Chernov wrote:
On Wed, Jan 25, 2012 at 07:16:41PM +, Mark Murray wrote:
I thought you were going to do this as a function? It would be
slightly neater to do it that way.
Looks good! Are you sure this needs no locking or volatile
Andrey Chernov writes:
The usual way round this is with a flag. Set a static, volatile
flag, defaulting off, and set it to on when the seeding has
happened. Then arc4random() can do the right thing, depending on
this flag.
Ok, what about this version, is it right? libkern/arc4rand.c is
On Sun, Jan 22, 2012 at 04:59:55PM +, Mark Murray wrote:
Andrey Chernov writes:
The usual way round this is with a flag. Set a static, volatile
flag, defaulting off, and set it to on when the seeding has
happened. Then arc4random() can do the right thing, depending on
this flag.
Andrey Chernov writes:
Should be in a header file, nad _possibly_ should be volatile. If it
works without being volatile, then OK.
It was preliminary patch just to confirm/deny my understanding of your
idea.
Ah, OK - in which case you got the idea correctly!
I'll put it into header.
Andrey Chernov writes:
Look at the function random_yarrow_unblock(). Thats where yopu want to
be doing this. This function is where the random device is unblocked
once safely seeded.
Thanx for your hint, but I fear one moment using random_yarrow_unblock().
It is called under
On Fri, Jan 20, 2012 at 03:12:53PM +, Mark Murray wrote:
Andrey Chernov writes:
Look at the function random_yarrow_unblock(). Thats where yopu want to
be doing this. This function is where the random device is unblocked
once safely seeded.
Thanx for your hint, but I fear one
Andrey Chernov writes:
On Mon, Jan 16, 2012 at 08:18:10PM +, David Schultz wrote:
Author: das
Date: Mon Jan 16 20:18:10 2012
New Revision: 230230
URL: http://svn.freebsd.org/changeset/base/230230
Log:
Generate a warning if the kernel's arc4random() is seeded with bogus
On Thu, Jan 19, 2012 at 07:52:30PM +, Mark Murray wrote:
Andrey Chernov writes:
On Mon, Jan 16, 2012 at 08:18:10PM +, David Schultz wrote:
Author: das
Date: Mon Jan 16 20:18:10 2012
New Revision: 230230
URL: http://svn.freebsd.org/changeset/base/230230
Log:
On Wed, Jan 18, 2012, Andrey Chernov wrote:
On Mon, Jan 16, 2012 at 08:18:10PM +, David Schultz wrote:
Author: das
Date: Mon Jan 16 20:18:10 2012
New Revision: 230230
URL: http://svn.freebsd.org/changeset/base/230230
Log:
Generate a warning if the kernel's arc4random() is
On Wed, Jan 18, 2012 at 12:54:40PM -0500, David Schultz wrote:
It appears to reseed arc4random's state exactly once, at whatever
unpredictable time devrandom decides to reseed itself. Are you
As fast as possible, immediatelly when we have enough good entropy.
trying to fix the problems that
On Mon, Jan 16, 2012 at 08:18:10PM +, David Schultz wrote:
Author: das
Date: Mon Jan 16 20:18:10 2012
New Revision: 230230
URL: http://svn.freebsd.org/changeset/base/230230
Log:
Generate a warning if the kernel's arc4random() is seeded with bogus
entropy.
While you are here, could
Author: das
Date: Mon Jan 16 20:18:10 2012
New Revision: 230230
URL: http://svn.freebsd.org/changeset/base/230230
Log:
Generate a warning if the kernel's arc4random() is seeded with bogus entropy.
Modified:
head/sys/dev/random/harvest.c
Modified: head/sys/dev/random/harvest.c
33 matches
Mail list logo