public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matt Mackall <mpm@selenic.com>
To: Adrian Bunk <bunk@kernel.org>
Cc: "Brandeburg, Jesse" <jesse.brandeburg@intel.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Chris Peterson <cpeterso@cpeterso.com>,
	jeff@garzik.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers/net: remove network drivers' last few uses of IRQF_SAMPLE_RANDOM
Date: Sat, 17 May 2008 19:36:08 -0500	[thread overview]
Message-ID: <1211070968.18026.113.camel@calx> (raw)
In-Reply-To: <20080515215517.GI1936@cs181133002.pp.htv.fi>


On Fri, 2008-05-16 at 00:55 +0300, Adrian Bunk wrote:
> On Thu, May 15, 2008 at 09:07:52AM -0700, Brandeburg, Jesse wrote:
> > Alan Cox wrote:
> > > Chris Peterson <cpeterso@cpeterso.com> wrote:
> > >> I know Jeff Garzik says he's not interested in an anti-entropy
> > >> pogrom for existing net drivers, but here is the patch if anyone
> > >> else is interested..? :)  
> > >> 
> > >> Only 12 net drivers are affected, the last of the
> > >> theoretically-exploitable network entropy. 
> > > 
> > > Looks fine to me. If Jeff doesn't want to touch them then send them
> > > direct to Andrew/Linus.
> > > 
> > > A more interesting alternative might be to mark things like network
> > > drivers with a new flag say IRQF_SAMPLE_DUBIOUS so that users can be
> > > given a switch to enable/disable their use depending upon the
> > > environment. 
> > 
> > we've been hearing rumblings of big customers wanting (maybe requiring)
> > wired network drivers from Intel to  advertise this flag.  Jeff have you
> > heard of such?
> > 
> > I think the argument is that a headless system (no keyboard/mouse, no
> > soundcard, probably no video) with a libata based driver and a network
> > driver without IRQF_SAMPLE_RANDOM has *no* sources of entropy.  In this
> > case the argument is very strong for at least *some* source of entropy
> > from interrupts so that randomness can get some external input.  Just
> > try rebuilding a kernel RPM over an ssh session and you'll see what I
> > mean.
> > 
> > In short, I agree with Alan's IRQF_SAMPLE_DUBIOUS, and know of Linux
> > customers who also want the same.
> 
> We have two random number interfaces:
> - /dev/random
> - /dev/urandom
> 
> If a customer wants to get data from /dev/random although there's not 
> enough entropy that's not a problem we can solve (we can only try to 
> gather more real entropy if possible).
> 
> If he can live with dubious data he can simply use /dev/urandom .
> 
> If a customer wants to use /dev/random and demands to get dubious data 
> there if nothing better is available fulfilling his wish only moves 
> the security bug from his crappy application to the Linux kernel.
> 
> But what we could perhaps do with some kind of IRQF_SAMPLE_DUBIOUS would 
> be to improve the quality of the data in /dev/urandom if there's not 
> enough entropy available?
> 
> I have seen embedded systems with zero entropy, and dubious entropy 
> might there be better than no entropy at all.
> Or am I wrong on the latter?

There are two issues that people need to separate here:

- sampling noise
- estimating entropy in that noise

It certainly makes sense to sample network timing noise. It often does
not make sense to assume that there's any entropy in those timing
samples. For instance:

- our clock resolution may be low enough that an attacker can guess our
samples (ie it's simply HZ, very common in embedded land)
- the bus involved (ISA, peripheral bus, even slow PCI) may have the
same issue
- it may be heavily correlated with some other measurement (ie network
vs disk samples on file servers)

We currently assume that IRQF_SAMPLE_RANDOM means 'this is a completely
trusted unobservable entropy source' which is obviously wrong for
network devices but is right for some other classes of device.

I'd personally prefer to add a new interface, eg
add_network_randomness(), that internalized the wisdom of what to do 
with network samples. Similarly, the various 'input'-like devices that
use SAMPLE_RANDOM should be switched to go through the 'input'
interface.

-- 
Mathematics is the supreme nostalgia of our time.


  parent reply	other threads:[~2008-05-18  0:47 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-15  7:11 [PATCH] drivers/net: remove network drivers' last few uses of IRQF_SAMPLE_RANDOM Chris Peterson
2008-05-15 13:21 ` Alan Cox
2008-05-15 16:07   ` Brandeburg, Jesse
2008-05-15 16:39     ` Alan Cox
2008-05-15 18:14       ` Jeff Garzik
2008-05-15 18:47         ` Kok, Auke
2008-05-15 19:10           ` Jeff Garzik
2008-05-15 18:50         ` Rick Jones
2008-05-15 19:11           ` Jeff Garzik
2008-05-15 19:55         ` [PATCH] " Jeff Garzik
2008-05-16  0:27           ` Andi Kleen
2008-05-16  9:56             ` Alan Cox
2008-05-16 10:19               ` Andi Kleen
2008-05-16 12:12                 ` Herbert Xu
2008-05-16 16:25                   ` Andi Kleen
2008-05-17  1:01                     ` Herbert Xu
2008-05-17 10:59                       ` Andi Kleen
2008-05-17 19:54                         ` Chris Peterson
2008-05-17 20:05                           ` Arjan van de Ven
2008-05-18 10:13                             ` Andi Kleen
2008-05-18 11:26                               ` Theodore Tso
2008-05-18 12:57                                 ` Joe Korty
2008-05-18 17:53                                 ` Andi Kleen
2008-05-25 15:26                                   ` Glen Turner
2008-05-19 12:29                                 ` Benny Amorsen
2008-05-18 10:08                           ` Andi Kleen
2008-05-22  9:28                     ` Helge Hafting
2008-05-16 13:20                 ` Adrian Bunk
2008-05-16 16:20                   ` Andi Kleen
2008-05-16 19:47               ` David Miller
2008-05-16 23:28         ` Rick Jones
2008-05-15 18:04     ` Jeff Garzik
2008-05-15 18:17       ` Rick Jones
2008-05-15 18:31         ` Jeff Garzik
2008-05-15 18:47           ` Kok, Auke
2008-05-15 19:21             ` Jeff Garzik
2008-05-15 20:01               ` Chris Peterson
2008-05-15 20:16                 ` Jeff Garzik
2008-05-15 20:39                   ` Kok, Auke
2008-05-15 21:47                 ` Theodore Tso
2008-05-15 21:58                   ` Jeff Garzik
2008-05-15 22:29                     ` Henrique de Moraes Holschuh
2008-05-15 22:44                       ` Jeff Garzik
2008-05-15 23:02                         ` Henrique de Moraes Holschuh
2008-05-15 23:36                           ` Theodore Tso
2008-05-15 23:46                             ` Henrique de Moraes Holschuh
2008-05-15 23:33                         ` Theodore Tso
2008-05-15 23:58                           ` Henrique de Moraes Holschuh
2008-05-16 13:21               ` Lennart Sorensen
2008-05-16 13:40                 ` Jeff Garzik
2008-05-16 13:59                   ` Will Newton
2008-05-16 14:15                     ` Lennart Sorensen
2008-05-16 14:27                     ` Jeff Garzik
2008-05-16 15:10                 ` Alan Cox
2008-05-16 17:36                   ` Lennart Sorensen
2008-05-16 18:11                     ` Alan Cox
2008-05-16 18:40                       ` Kok, Auke
2008-05-18 10:59                         ` Matthias Andree
2008-05-16 18:41                       ` Lennart Sorensen
2008-05-16 18:42                         ` Lennart Sorensen
2008-05-16 20:04                         ` Alan Cox
2008-05-16 20:39                           ` Lennart Sorensen
2008-05-16 20:46                             ` Alan Cox
2008-05-16 20:34                       ` Benny Amorsen
2008-05-25 15:02                         ` Glen Turner
2008-05-25 19:33                           ` Benny Amorsen
2008-05-17  4:55                       ` Chris Peterson
2008-05-25 15:09                         ` Glen Turner
2008-05-25 23:27                           ` Theodore Tso
2008-05-26 13:43                             ` Alejandro Riveira Fernández
2008-05-26 15:14                               ` Bill Fink
2008-05-26 21:07                                 ` Krzysztof Halasa
2008-05-26 21:52                                   ` Bill Fink
2008-05-26 22:11                                     ` Ben Hutchings
2008-05-27 16:44                                 ` Rick Jones
2008-05-30 19:50                                 ` Pavel Machek
     [not found]                     ` <20080516191125.46 <20080525232712.GF5970@mit.edu>
2008-05-26 21:08                       ` Gilles Espinasse
2008-05-25 14:55             ` Glen Turner
     [not found]           ` <482C8550 <20080516161029.44ded734@core>
2008-05-16 20:08             ` Gilles Espinasse
2008-05-17 22:02               ` Adrian Bunk
2008-05-18  6:41                 ` [PATCH] drivers/net: remove network drivers' last few uses ofIRQF_SAMPLE_RANDOM Gilles Espinasse
2008-05-18  9:54                   ` Alan Cox
2008-05-18 12:02                   ` Adrian Bunk
2008-05-18 12:24                     ` Theodore Tso
2008-05-18 14:43                       ` Adrian Bunk
2008-05-15 21:55     ` [PATCH] drivers/net: remove network drivers' last few uses of IRQF_SAMPLE_RANDOM Adrian Bunk
2008-05-15 22:04       ` Jeff Garzik
2008-05-15 22:27         ` Theodore Tso
2008-05-15 22:13       ` Jesper Juhl
2008-05-15 22:34         ` Theodore Tso
2008-05-15 22:57           ` Jesper Juhl
2008-05-18  0:36       ` Matt Mackall [this message]
2008-05-18 11:03         ` Matthias Andree
2008-05-15 22:42     ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2010-04-10  5:29 Chris Peterson
2010-04-15  6:42 ` David Miller

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=1211070968.18026.113.camel@calx \
    --to=mpm@selenic.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bunk@kernel.org \
    --cc=cpeterso@cpeterso.com \
    --cc=jeff@garzik.org \
    --cc=jesse.brandeburg@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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