All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Update the random(4) documentation towards a more accurate view on /dev/urandom
@ 2016-04-25  8:48 Nikos Mavrogiannopoulos
       [not found] ` <1461574090.32558.45.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 39+ messages in thread
From: Nikos Mavrogiannopoulos @ 2016-04-25  8:48 UTC (permalink / raw)
  To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w
  Cc: linux-man-u79uwXL29TY76Z2rM5mHXA, linux-gpGsJRJZ3PBBDgjK7y7TUQ,
	mpm-VDJrAJ4Gl5ZBDgjK7y7TUQ

This documents the "property" of /dev/urandom of being able to serve numbers
prior to pool being initialized, and removes any suggested usages of /dev/random
which are disputable (i.e., one-time pad).
Document the fact /dev/random is only suitable for applications which can afford
indeterminate delays since very few applications can do so.
Smooth the alarming language about a theoretical attack, and mention that its
security depends on the cryptographic primitives used by the kernel, as well
as the total entropy gathered.

Signed-off-by: Nikos Mavrogiannopoulos <nmav-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 man4/random.4 | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/man4/random.4 b/man4/random.4
index b6fdd8c..27a78c6 100644
--- a/man4/random.4
+++ b/man4/random.4
@@ -38,10 +38,10 @@ number of bits of noise in the entropy pool.
 From this entropy pool random numbers are created.
 .LP
 When read, the \fI/dev/random\fP device will return random bytes
-only within the estimated number of bits of noise in the entropy
+only within the estimated number of bits of fresh noise in the entropy
 pool.
-\fI/dev/random\fP should be suitable for uses that need very
-high quality randomness such as one-time pad or key generation.
+\fI/dev/random\fP is suitable for uses that need very
+high quality randomness, and can afford indeterminate delays.
 When the entropy pool is empty, reads from \fI/dev/random\fP will block
 until additional environmental noise is gathered.
 If
@@ -63,15 +63,20 @@ will be set to
 .LP
 A read from the \fI/dev/urandom\fP device will not block
 waiting for more entropy.
-If there is not sufficient entropy, a pseudorandom number generator is used
-to create the requested bytes.
-As a result, in this case the returned values are theoretically vulnerable to a
-cryptographic attack on the algorithms used by the driver.
-Knowledge of how to do this is not available in the current unclassified
-literature, but it is theoretically possible that such an attack may
-exist.
-If this is a concern in your application, use \fI/dev/random\fP
-instead.
+If the estimated fresh entropy is not sufficient, a pseudorandom number generator is
+used to create the requested bytes. This is typically of no concern to applications,
+except for applications that initialize early at boot time, in systems which cannot
+accumulate sufficient entropy at boot.
+
+As a result, in this case the returned values' security depends on
+the cryptographic primitives used by the driver, and the entropy accumulated
+by the system. An attack on the cryptographic primitives is not available in the
+current unclassified literature, but it is theoretically possible that such an attack
+exists.
+
+If these are a concern in your application, use
+.BR getrandom(2)
+or \fI/dev/random\fP instead.
 .B O_NONBLOCK
 has no effect when opening
 .IR /dev/urandom .
@@ -109,9 +114,6 @@ If you are unsure about whether you should use
 or
 .IR /dev/urandom ,
 then probably you want to use the latter.
-As a general rule,
-.IR /dev/urandom
-should be used for everything except long-lived GPG/SSL/SSH keys.
 
 If a seed file is saved across reboots as recommended below (all major
 Linux distributions have done this since 2000 at least), the output is
-- 
2.5.5







--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2016-11-15  6:41 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-25  8:48 [PATCH] Update the random(4) documentation towards a more accurate view on /dev/urandom Nikos Mavrogiannopoulos
     [not found] ` <1461574090.32558.45.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-04-25 15:46   ` George Spelvin
     [not found]     ` <20160425154605.7445.qmail-HzZAx2gCgqrSUeElwK9/Pw@public.gmane.org>
2016-04-26 14:46       ` Nikos Mavrogiannopoulos
     [not found]         ` <1461681983.15804.76.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-04-26 16:58           ` George Spelvin
     [not found]             ` <20160426165847.5804.qmail-HzZAx2gCgqrSUeElwK9/Pw@public.gmane.org>
2016-11-09 15:26               ` Michael Kerrisk (man-pages)
     [not found]                 ` <8a990d27-1fc2-8358-f9d3-c9474d6d8616-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-11-10  8:21                   ` Nikos Mavrogiannopoulos
     [not found]                     ` <1478766102.2642.12.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-11-10 11:29                       ` Michael Kerrisk (man-pages)
2016-08-01 11:48   ` Nikos Mavrogiannopoulos
     [not found]     ` <1470052099.2926.6.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-10-20  8:37       ` Nikos Mavrogiannopoulos
     [not found]         ` <1476952646.2522.10.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-10-21  7:21           ` Michael Kerrisk (man-pages)
     [not found]             ` <8a5e82db-6f8a-2426-4a68-feab205bca57-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-10-21 14:07               ` Stephan Mueller
     [not found]                 ` <2402524.TIv9Kdt40z-gNvIQDDl/k7Ia13z/PHSgg@public.gmane.org>
2016-10-21 14:38                   ` Nikos Mavrogiannopoulos
     [not found]                     ` <1477060710.3888.14.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-10-21 14:55                       ` Stephan Mueller
2016-10-21 16:33                   ` Theodore Ts'o
     [not found]                     ` <20161021163314.cvhjgr4s7lfzdsve-AKGzg7BKzIDYtjvyW6yDsg@public.gmane.org>
2016-10-21 16:50                       ` Stephan Mueller
     [not found]                         ` <4610047.a51zB7LfZj-gNvIQDDl/k7Ia13z/PHSgg@public.gmane.org>
2016-10-21 17:56                           ` Theodore Ts'o
     [not found]                             ` <20161021175633.5x5mp2xv3wq4ejjf-AKGzg7BKzIDYtjvyW6yDsg@public.gmane.org>
2016-10-21 18:00                               ` Stephan Mueller
2016-11-01  9:35               ` Nikos Mavrogiannopoulos
     [not found]                 ` <1477992912.3769.22.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-11-09 14:58                   ` Michael Kerrisk (man-pages)
2016-11-09 15:23           ` Michael Kerrisk (man-pages)
     [not found]             ` <b07fb334-149d-cf65-74f3-1d1951e5981b-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-11-10  8:54               ` Nikos Mavrogiannopoulos
     [not found]                 ` <1478768067.2642.23.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-11-10  9:11                   ` Laurent Georget
     [not found]                     ` <3b7ba39b-0434-47ca-7857-257f3c99266b-AyimVQWTEHzsq35pWSNszA@public.gmane.org>
2016-11-10 11:56                       ` Michael Kerrisk (man-pages)
2016-11-10 11:50                   ` Michael Kerrisk (man-pages)
     [not found]                     ` <e5c1f87c-aad0-b526-a346-74348a36c2a3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-11-10 11:53                       ` Nikos Mavrogiannopoulos
     [not found]                         ` <1478778837.2642.26.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-11-10 11:56                           ` Michael Kerrisk (man-pages)
     [not found]                             ` <05152136-6943-8ada-3d65-51ef4ce9c1b1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-11-10 14:19                               ` Michael Kerrisk (man-pages)
2016-11-10 14:20                               ` [PATCH] random.4: Improve discussion or urandom, blocking reads, and signals Michael Kerrisk (man-pages)
     [not found]                                 ` <4a8c573c-0c19-29d0-248e-74c088968806-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-11-11 10:28                                   ` Laurent Georget
     [not found]                                     ` <d5eca965-c8b9-51e5-6acb-172e47f85ba0-vbcOdlJ0SulGWvitb5QawA@public.gmane.org>
2016-11-11 11:51                                       ` Michael Kerrisk (man-pages)
2016-11-12 12:25                                       ` New random(7) page for review Michael Kerrisk (man-pages)
     [not found]                                         ` <cb25213c-a70d-cbf1-6a42-959dcdc1f202-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-11-12 14:03                                           ` Laurent Georget
     [not found]                                             ` <54e6e40c-b840-c773-e739-7faed9664411-AyimVQWTEHzsq35pWSNszA@public.gmane.org>
2016-11-15  6:19                                               ` Michael Kerrisk (man-pages)
2016-11-13 22:20                                           ` Theodore Ts'o
     [not found]                                             ` <20161113222041.ypnz3sdm3fmjprnn-AKGzg7BKzIDYtjvyW6yDsg@public.gmane.org>
2016-11-15  6:41                                               ` Michael Kerrisk (man-pages)
2016-11-14  8:06                                           ` Nikos Mavrogiannopoulos
     [not found]                                             ` <1479110801.2624.2.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-11-15  6:10                                               ` Michael Kerrisk (man-pages)
2016-11-11 16:05                                   ` [PATCH] random.4: Improve discussion or urandom, blocking reads, and signals Theodore Ts'o
     [not found]                                     ` <20161111160514.yrlfteowdz4qar76-AKGzg7BKzIDYtjvyW6yDsg@public.gmane.org>
2016-11-12 10:54                                       ` Michael Kerrisk (man-pages)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.