Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1743327
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Ben Hutchings <ben@decadent.org.uk> |
| Newsgroups | linux.debian.devel.release, linux.debian.kernel, linux.kernel |
| Subject | Re: Fixing Linux getrandom() in stable |
| Date | Mon, 14 May 2018 04:20:02 +0200 |
| Message-ID | <vPbfI-2s2-1@gated-at.bofh.it> (permalink) |
| References | <vNG4i-TU-1@gated-at.bofh.it> <vP66r-7vU-3@gated-at.bofh.it> |
| X-Mailbox-Line | From debian-release-request@lists.debian.org Mon May 14 02:11:59 2018 |
| Old-Return-Path | <ben@decadent.org.uk> |
| X-Amavis-Spam-Status | No, score=-12.063 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, LDO_WHITELIST=-5, PGPSIGNATURE=-5, RCVD_IN_DNSWL_LOW=-0.7, SARE_MSGID_LONG40=0.637] autolearn=ham autolearn_force=no |
| X-Policyd-Weight | using cached result; rate: -6.1 |
| Content-Type | multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-fPt2BSZn9gfbAMq4dtff" |
| X-Mailer | Evolution 3.28.1-2 |
| MIME-Version | 1.0 |
| X-Sa-Exim-Connect-IP | 2a02:8011:400e:2:6f00:88c8:c921:d332 |
| X-Sa-Exim-Mail-From | ben@decadent.org.uk |
| X-Sa-Exim-Scanned | No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false |
| X-Mailing-List | <debian-release@lists.debian.org> archive/latest/114476 |
| List-ID | <debian-release.lists.debian.org> |
| List-URL | <https://lists.debian.org/debian-release/> |
| List-Archive | https://lists.debian.org/msgid-search/71fc1f9e921f2a755e79563903ddf676de128478.camel@decadent.org.uk |
| Approved | robomod@news.nic.it |
| Lines | 134 |
| Organization | linux.* mail to news gateway |
| Sender | robomod@news.nic.it |
| X-Original-Cc | Debian release team <debian-release@lists.debian.org>, Debian kernel maintainers <debian-kernel@lists.debian.org>, krb5@packages.debian.org, libbsd@packages.debian.org, systemd@packages.debian.org, Michael Kerrisk <mtk.manpages@gmail.com>, Theodore Ts'o <tytso@mit.edu>, linux-kernel@vger.kernel.org |
| X-Original-Date | Mon, 14 May 2018 03:11:30 +0100 |
| X-Original-Message-ID | <71fc1f9e921f2a755e79563903ddf676de128478.camel@decadent.org.uk> |
| X-Original-References | <75577b3d2efd01aaf563f1a1400a2c655556b258.camel@decadent.org.uk> <20180513204828.GI10643@localhost> |
| Xref | csiph.com linux.debian.devel.release:79922 linux.debian.kernel:61003 linux.kernel:1743327 |
Cross-posted to 3 groups.
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
On Sun, 2018-05-13 at 23:48 +0300, Adrian Bunk wrote: > On Wed, May 09, 2018 at 11:46:00PM +0100, Ben Hutchings wrote: [...] > > # Options for a new fix > > > > It is unlikely that any further fix will be forthcoming on the kernel > > side, so I believe that we need to do one of: > > > > 1. Add entropy to the kernel during boot; either: > > a. Improve systemd-random-seed > > b. Recommend use of haveged > > I don't see any solution above that both always works and never results > in new CVEs. Indeed. > As an example, what happens if I debootstrap and deploy the resulting > filesytem to a large number of identical embedded systems without > entropy sources? Then it is your fault when they turn into a botnet. :-) Availability of randomness must be considered in the design of embedded systems. [...] > /dev/urandom is documented in a very misleading way, quoting random(4): > When read during early boot time, /dev/urandom may return data prior to > the entropy pool being initialized. If this is of concern in your > application, use getrandom(2) or /dev/random instead. > > What is the worst case for "early boot time" here? "always"? No, I don't think so. > Due to the gdm bugs mentioned above we know that there are real-life > situations where gdm currently uses "random" data that might be > predictable. > > grep tells me: > daemon/gdm-x-session.c: auth_entry.data = gdm_generate_random_bytes (auth_entry.data_length, &error); > daemon/gdm-display-access-file.c: *cookie = gdm_generate_random_bytes (GDM_DISPLAY_ACCESS_COOKIE_SIZE, > > Repeat the same for every package that uses /dev/urandom. This is certain undesirable, but it's exploitable only by local users. (If you let the X server listen to the network, all authentication cookies are sent in the clear so you've already lost. If you use ssh X forwarding, it generates a new authentication cookie for use with the X proxy on the remote machine.) > > > b. Tolerate a longer wait for getrandom() to return > > I suspect there might be no guaranteed upper bound for the waiting time. Interrupt timing feeds into the RNG, and as long as there's at least one interrupt per second then I think the RNG will reach the fully initialised state after a few minutes. I just started a VM with a serial console and only a shell running as pid 1, which is about as idle a system as I can imagine, and it was seeing more than one interrupt per second. However, other architectures (e.g. s390x) might achieve greater idleness. > > ... > > The libbsd maintainer (Guillem Jover) favours option 2a. > > > > One of the krb5 maintainers (Benjamin Kaduk) favours option 2b, and > > also proposed that systemd could provide a wait-for-rng-ready unit to > > support this. > > I don't see any general solution that is both correct and easy. Indeed. > The proper way forward might be to deprecate /dev/urandom and add a > third option GRND_UNSAFE_RANDOM to getrandom() that is documented to > never block but might return predictable data in some cases. This doesn't solve anything for us. (It does help with the original problem of device nodes possibly being absent from a minimal container or chroot.) > It would then be up to the application to decide whether predictable > data is acceptable, and what to do in entropy-starved situations. > > Regarding the suggested wait-for-rng-ready systemd unit for others to > wait on, this only makes sense for cases where "do not start at all" > is the best handling for a "no entropy" situation. Yes. Ben. > > Ben. > > cu > Adrian > -- Ben Hutchings For every action, there is an equal and opposite criticism. - Harrison
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Fixing Linux getrandom() in stable Adrian Bunk <bunk@debian.org> - 2018-05-13 22:50 +0200
Re: Fixing Linux getrandom() in stable Thorsten Glaser <tg@mirbsd.de> - 2018-05-13 23:40 +0200
Re: Fixing Linux getrandom() in stable Thorsten Glaser <tg@mirbsd.de> - 2018-05-14 03:00 +0200
Re: Fixing Linux getrandom() in stable "Theodore Y. Ts'o" <tytso@mit.edu> - 2018-05-14 03:20 +0200
Re: Fixing Linux getrandom() in stable Sam Hartman <hartmans@debian.org> - 2018-05-14 15:20 +0200
Re: Fixing Linux getrandom() in stable Ben Hutchings <ben@decadent.org.uk> - 2018-05-14 04:20 +0200
Re: Fixing Linux getrandom() in stable Adrian Bunk <bunk@debian.org> - 2018-05-22 21:50 +0200
csiph-web