From: Michael Buesch <mb@bu3sch.de>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Matt Mackall <mpm@selenic.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFC #2] hwrng: Add type categories
Date: Wed, 27 Jun 2007 19:54:16 +0200 [thread overview]
Message-ID: <200706271954.16963.mb@bu3sch.de> (raw)
In-Reply-To: <20070627170331.GB6508@khazad-dum.debian.net>
On Wednesday 27 June 2007 19:03:31 Henrique de Moraes Holschuh wrote:
> On Wed, 27 Jun 2007, Michael Buesch wrote:
> > Well, we have that userspace ABI of one hwrng char device. I did not
>
> Yeah. Talk about shortsighted ABIs that deserve to die an horrible death.
> The same goes for the watchdog ABI.
>
> > And changing it in a compatible way is probably difficult.
>
> Well, sort of. Some sort of compromise will have to be taken.
>
> IMHO, anything worth bothering with in userspace will react well to a
> symlink in /dev/hw_random, which is userspace's problem to set. Anyone else
> is expected to fix his /dev or whatever when they upgrade kernels, and we
> can always provide the old hw_random char device returning EFAULT or
> somesuch, so that it becomes very obvious that something is in need of
> attention (and it FAILS instead of just disappearing).
>
> > And then we would _still_ export some kind of hint for rngd that
> > the CPU rng device should be preferred over the bcm43xx device.
>
> Yes, export all the characterisitics of the RNG, and let userspace decide
> what to do.
>
> > How would you implement that? (We're back to my TYPE_XXX definitions ;) )
>
> I'd implement it as an IOCTL with gives back:
>
> 1. Hardware device name
> 2. Hardware device revision
> 3. expected worst-case minimum entropy per bit of output
> 4. current config expected minimum entropy per bit of output
> 5. average bit rate (worst config)
> 6. average bit rate (current config)
>
> There are probably others, but they don't come to mind at the moment. We
> could add something for type of device (oscilators, radioactive decay,
> whatever), I suppose.
>
> Use some magic value (0x00 ?) for unknown. I won't bother with the scales,
> if someone is going to write this, we can decide that later. Just remember
> that there are 10 Mbit/s RNGs out there, and 100 bit/s RNGs out there, and
> that entropy goes from 0/unknown to 1 and needs at least a precison of
> 10^-3.
>
> You also need a way to lock the RNG configuration, and you need to detect if
> you ever read a byte from it that was produced by a different
> configuration, which probably means a few more IOCTLs.
Ok, all very good ideas. Patches are welcome ;)
> I don't much like sysfs over IOCTLs for this, as you will probably need to
> be able to set and get things in an atomic way. A sysfs binary attribute
> would also work. A sysfs one-value-per-attribute bunch of them is
> completely useless from a security point of view.
hm? Why?
--
Greetings Michael.
next prev parent reply other threads:[~2007-06-27 17:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-26 18:21 [PATCH RFC #2] hwrng: Add type categories Michael Buesch
2007-06-26 22:45 ` Matt Mackall
2007-06-27 2:40 ` Matt Mackall
2007-06-27 2:48 ` Henrique de Moraes Holschuh
2007-06-27 13:05 ` Michael Buesch
2007-06-27 13:10 ` Michael Buesch
2007-06-27 17:03 ` Henrique de Moraes Holschuh
2007-06-27 17:54 ` Michael Buesch [this message]
2007-06-28 8:07 ` Henrique de Moraes Holschuh
2007-07-08 12:53 ` Pavel Machek
2007-06-27 12:57 ` Michael Buesch
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=200706271954.16963.mb@bu3sch.de \
--to=mb@bu3sch.de \
--cc=akpm@linux-foundation.org \
--cc=hmh@hmh.eng.br \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
/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