public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* reading the same entropy twice
@ 2005-02-22 21:55 Bob O'Neill
  2005-02-22 22:08 ` Lee Revell
  2005-02-23  6:39 ` Matt Mackall
  0 siblings, 2 replies; 3+ messages in thread
From: Bob O'Neill @ 2005-02-22 21:55 UTC (permalink / raw)
  To: linux-kernel

Hello.

I have noticed that it is possible on an SMP box for two processes to
simultaneously read the same entropy out of /dev/urandom.  This
doesn't seem right to me.  I was using the entropy value to generate a
random number to use as a session ID, so occasionally there would be a
collision on session IDs, causing a login failure as session IDs are
required to be unique.  This issue does not appear to be related to
entropy depletion.

Could you provide me with some insight into why this is the case, if
it is intentional?  It seems like it could be addressed with a
spinlock.

Thanks.
-Bob

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: reading the same entropy twice
  2005-02-22 21:55 reading the same entropy twice Bob O'Neill
@ 2005-02-22 22:08 ` Lee Revell
  2005-02-23  6:39 ` Matt Mackall
  1 sibling, 0 replies; 3+ messages in thread
From: Lee Revell @ 2005-02-22 22:08 UTC (permalink / raw)
  To: Bob O'Neill; +Cc: linux-kernel

On Tue, 2005-02-22 at 16:55 -0500, Bob O'Neill wrote:
> Hello.
> 
> I have noticed that it is possible on an SMP box for two processes to
> simultaneously read the same entropy out of /dev/urandom.  This
> doesn't seem right to me.  I was using the entropy value to generate a
> random number to use as a session ID, so occasionally there would be a
> collision on session IDs, causing a login failure as session IDs are
> required to be unique.  This issue does not appear to be related to
> entropy depletion.
> 
> Could you provide me with some insight into why this is the case, if
> it is intentional?  It seems like it could be addressed with a
> spinlock.

Please check the LKML archives, this was debated at length last month
IIRC.  I don't recall whether it ended conclusivelty.

Lee


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: reading the same entropy twice
  2005-02-22 21:55 reading the same entropy twice Bob O'Neill
  2005-02-22 22:08 ` Lee Revell
@ 2005-02-23  6:39 ` Matt Mackall
  1 sibling, 0 replies; 3+ messages in thread
From: Matt Mackall @ 2005-02-23  6:39 UTC (permalink / raw)
  To: Bob O'Neill; +Cc: linux-kernel

On Tue, Feb 22, 2005 at 04:55:39PM -0500, Bob O'Neill wrote:
> Hello.
> 
> I have noticed that it is possible on an SMP box for two processes to
> simultaneously read the same entropy out of /dev/urandom.  This
> doesn't seem right to me.  I was using the entropy value to generate a
> random number to use as a session ID, so occasionally there would be a
> collision on session IDs, causing a login failure as session IDs are
> required to be unique.  This issue does not appear to be related to
> entropy depletion.
> 
> Could you provide me with some insight into why this is the case, if
> it is intentional?  It seems like it could be addressed with a
> spinlock.

This should be fixed in current kernels.

-- 
Mathematics is the supreme nostalgia of our time.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-02-23  6:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-22 21:55 reading the same entropy twice Bob O'Neill
2005-02-22 22:08 ` Lee Revell
2005-02-23  6:39 ` Matt Mackall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox