Skip to contentSkip to conversation

reading the same entropy twice

DISCUSSION Bob O'Neill 3 participants 3 messages Feb 22, 2005 – Feb 23, 2005

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 10 lines · Bob O'Neill

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.

Quoted 3 lines

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

#2 lore raw
In reply to Bob O'Neill
Quoted 10 lines · Bob O'Neill

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.

Quoted 3 lines

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.

Signature · 1 line
Mathematics is the supreme nostalgia of our time.