linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Eli Billauer <eli_billauer@users.sf.net>
Cc: linux-kernel@vger.kernel.org, Nick Piggin <piggin@cyberone.com.au>
Subject: Re: [RFC] frandom - fast random generator module
Date: Thu, 16 Oct 2003 07:29:05 -0400	[thread overview]
Message-ID: <3F8E8101.70009@pobox.com> (raw)
In-Reply-To: <3F8E70E0.7070000@users.sf.net>

Eli Billauer wrote:
> I suppose you're asking why having a /dev/frandom device at all. Why not 
> let everyone write their own little random generator (based upon 
> well-known C functions) whenever random data is needed.
> 
> There are plenty of handy things in the kernel, that could be done in 
> userspace. /dev/zero is my favourite example, but I'm sure there are 
> other cases where things were put in the kernel simply because people 
> found them handy. Which is a good reason, if you ask me.
> 
> Besides, it's quite easy to do something wrong with random numbers. By 
> having a good source of random data, I suppose we can spare a lot of 
> people the headache of getting their own user-space application right 
> for the one-off thing they want to do.

This is completely bogus logic.  I can use this (incorrect) argument to 
similar push for applications doing bsearch(3) or qsort(3) via a system 
call.

When the _implementation_ requires that a piece of code be in-kernel 
(for performance or security, usually), it is.

In this case, there is no such requirement.  More below.


> But it's really a matter of taste. That's why I bring up the subject here.


Processors are trending towards putting RNG on the CPU.  VIA won't be 
the last, I predict.  When generating random bits is a single 
instruction, "xstore", userspace applications _should_ be directly using 
this.  It should not be in-kernel.  And similarly, if there is no 
requirement that the kernel's entropy pool is used, the userspace 
application _should_ be where the implementation lives.

So, given that trend and also given the existing /dev/[u]random, I 
disagree completely:  /dev/frandom is the perfect example of something 
that should _not_ be in the kernel.  If you want /dev/urandom faster, 
then solve _that_ problem.  Don't try to solve a /dev/urandom problem by 
creating something totally new.

	Jeff



  parent reply	other threads:[~2003-10-16 11:29 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-16  8:22 [RFC] frandom - fast random generator module Eli Billauer
2003-10-16  8:36 ` Nick Piggin
2003-10-16 10:20   ` Eli Billauer
2003-10-16 10:48     ` Nick Piggin
2003-10-16 11:29     ` Jeff Garzik [this message]
2003-10-16 12:27       ` Eli Billauer
2003-10-16 15:10         ` Jeff Garzik
2003-10-16 16:20       ` Andreas Dilger
2003-10-16 16:31         ` Jeff Garzik
2003-10-16 18:18           ` Andreas Dilger
2003-10-16 18:52             ` Richard B. Johnson
2003-10-16 19:31             ` Matt Mackall
2003-10-16 20:40               ` Andreas Dilger
2003-10-16 21:03             ` David Wagner
2003-10-16 23:17             ` Jeff Garzik
2003-10-16 23:42               ` Andreas Dilger
2003-10-17  0:34                 ` David Wagner
2003-10-16 17:45         ` Matt Mackall
2003-10-16 18:38           ` Andreas Dilger
2003-10-16 19:08             ` Matt Mackall
2003-10-16 20:27               ` Andreas Dilger
2003-10-16 20:37                 ` Matt Mackall
2003-10-16 17:31       ` Matt Mackall
2003-10-16 23:03         ` Eli Billauer
2003-10-16 23:07           ` Jeff Garzik
2003-10-16 23:13           ` Matt Mackall
2003-10-16 23:35           ` jw schultz
2003-10-21 19:24       ` bill davidsen
2003-10-21 19:55       ` bill davidsen
2003-10-21 21:21         ` Helge Hafting
2003-10-21 22:18           ` bill davidsen
2003-10-22  1:04             ` H. Peter Anvin
2003-10-21 19:17   ` bill davidsen
2003-10-21 21:00     ` H. Peter Anvin
2003-10-21 22:08       ` bill davidsen
2003-10-22  1:06         ` H. Peter Anvin
2003-10-22  2:56           ` jw schultz
2003-10-22 16:22             ` Kent Borg
2003-10-23  2:46               ` Dale Farnsworth
2003-10-23  3:22               ` Sandy Harris
2003-10-23 14:15                 ` Kent Borg
2003-10-24 17:37                 ` bill davidsen
2003-10-24 17:54                   ` Theodore Ts'o
2003-10-24 20:59                   ` David Wagner
2003-10-24 21:33                     ` jw schultz
2003-10-22  3:49           ` Sandy Harris
2003-10-16 10:45 ` Ingo Oeser
2003-10-21 19:30   ` bill davidsen
     [not found] <HbGf.8rL.1@gated-at.bofh.it>
     [not found] ` <HbQ5.ep.27@gated-at.bofh.it>
     [not found]   ` <Hdyv.2Vd.13@gated-at.bofh.it>
     [not found]     ` <HeE6.4Cc.1@gated-at.bofh.it>
     [not found]       ` <HjaT.3nN.7@gated-at.bofh.it>
     [not found]         ` <Hjkw.3Al.11@gated-at.bofh.it>
2003-10-16 17:46           ` David Mosberger-Tang
2003-10-16 19:28             ` Eli Billauer
2003-10-16 20:42               ` Andreas Dilger
2003-10-21 19:46                 ` bill davidsen
2003-10-16 21:30               ` Matt Mackall

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=3F8E8101.70009@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=eli_billauer@users.sf.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=piggin@cyberone.com.au \
    /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;
as well as URLs for NNTP newsgroup(s).