public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Jeff Garzik <jeff@garzik.org>
Cc: Matthew Wilcox <matthew@wil.cx>,
	Patrick_Boyd@dell.com, James.Smart@emulex.com,
	linux-scsi@vger.kernel.org
Subject: Re: generating a Linux WWN?
Date: Mon, 1 Oct 2007 12:56:36 +0200	[thread overview]
Message-ID: <200710011256.36708.ak@suse.de> (raw)
In-Reply-To: <46FC332E.2040001@garzik.org>


> The popular solutions I've seen are:
> 
> 1) Random bytes, or fixed id + random bytes.  Even on a worldwide net, 
> collisions are highly unlikely.

The problem is that the random bytes are not necessarily random; especially
not at boot:

get_random_bytes gets its randomness from the entropy pool. The pool starts with the 
time of the day and some always the same data and then gets feed by time 
stamps from a few interrupts. This doesn't include network interrupts
(or rather only a small handfull of network drivers set the flag -- but
at early boot you don't have any network anyways), but is primarily keyboard/mouse 
and storage interrupts. On headless systems typically only storage interrupts.

Now do you see the problem with using get_random_bytes() to get your
storage working? In many cases the time of the day in the pool
will prevent the worst, but if you have a cluster where all boxes boot 
at the same time it's quite likely your early randomness will
be all the same.(ok cluster boots are usually staggered, but you
still have a large number of systems booting at the same time) 

The whole thing would probably work if you could mix something 
machine unique into the entropy pool at boot (e.g. a network
mac address); but Linux can't do that do to boot strap ordering
issues.

I agree with the people who say this is a highly dangerous
thing to do. It is much better to fail clearly that to create a hard
to debug subtle problem in a storage network.

If you have prototype hardware that doesn't supply an unique ID then
I would suggest you add some module parameter to allow choosing a unique 
(or even random) one. But don't make it default.

-Andi


  reply	other threads:[~2007-10-01 10:56 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-27 10:04 generating a Linux WWN? Jeff Garzik
2007-09-27 13:55 ` Michael Reed
2007-09-27 14:04 ` James Smart
2007-09-27 14:16   ` Patrick_Boyd
2007-09-27 14:46     ` Matthew Wilcox
2007-09-27 15:07       ` Michael Reed
2007-09-27 15:12         ` Michael Reed
2007-09-27 23:40         ` Jeff Garzik
2007-09-27 22:48       ` Jeff Garzik
2007-10-01 10:56         ` Andi Kleen [this message]
2007-09-27 14:19   ` Jeff Garzik
2007-09-27 14:29     ` Michael Reed
2007-09-27 15:30       ` Douglas Gilbert
2007-09-27 22:32         ` Jeff Garzik
2007-09-27 23:12       ` Jeff Garzik
2007-10-02 23:47         ` Luben Tuikov
2007-10-03  0:35           ` Jeff Garzik
2007-10-03  3:45             ` Luben Tuikov
2007-10-03  4:15               ` Jeff Garzik
2007-10-03  5:12                 ` Luben Tuikov
2007-10-03  5:25                   ` Jeff Garzik
2007-10-03  5:31                     ` Luben Tuikov
2007-10-03  5:45                       ` Jeff Garzik
2007-10-03 14:59                         ` Douglas Gilbert
2007-10-03 16:16                           ` Jeff Garzik
2007-10-03 18:02                         ` Matthew Jacob
2007-10-03 18:09                           ` Jeff Garzik
2007-10-03 19:44                             ` Luben Tuikov
2007-10-03 20:25                               ` Jeff Garzik
2007-10-03 22:08                                 ` Luben Tuikov
2007-10-03 22:17                                   ` David Miller
2007-10-04  0:11                                     ` Luben Tuikov
2007-10-04  3:23                                       ` Matthew Jacob
2007-10-04  3:27                                         ` Jeff Garzik
2007-10-04  3:33                                         ` Matthew Wilcox
2007-10-05 22:09                                     ` James Bottomley
2007-10-05 22:11                                       ` David Miller
2007-10-05 22:14                                         ` James Bottomley
2007-10-05 22:17                                           ` David Miller
2007-10-05 22:41                                             ` Jeff Garzik
2007-10-05 22:49                                               ` David Miller
2007-10-05 22:52                                                 ` Jeff Garzik
2007-10-06 14:11                                             ` James Bottomley
2007-10-06 14:36                                               ` Jeff Garzik
2007-10-06 15:04                                                 ` James Bottomley
2007-10-06 15:23                                                   ` Jeff Garzik
2007-10-06 15:33                                                     ` James Bottomley
2007-10-06 15:42                                                       ` Jeff Garzik
2007-10-08 18:42                                                     ` Luben Tuikov
2007-10-07  2:48                                                   ` David Miller
2007-10-08 15:41                                                     ` Michael Reed
2007-10-08 18:34                                                 ` Luben Tuikov
2007-10-07  2:46                                               ` David Miller
2007-10-08 18:18                                       ` Luben Tuikov
2007-10-03  5:38                     ` Luben Tuikov
2007-10-03  5:47                       ` Jeff Garzik
2007-10-03 15:33                         ` Michael Reed
2007-10-03 16:02                           ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200710011256.36708.ak@suse.de \
    --to=ak@suse.de \
    --cc=James.Smart@emulex.com \
    --cc=Patrick_Boyd@dell.com \
    --cc=jeff@garzik.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=matthew@wil.cx \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox