installer ought to install a proper random-seed

Bug #1651947 reported by John Denker
264
This bug affects 2 people
Affects Status Importance Assigned to Milestone
livecd-rootfs (Ubuntu)
Invalid
Undecided
Unassigned
ubiquity (Ubuntu)
Invalid
High
Dimitri John Ledkov

Bug Description

Observed behavior: The Ubuntu "Live CD" installer creates
a file on the installee (i.e. target) filesystem called
   /var/lib/systemd/random-seed
but alas it has zero length.

Desired behavior: The installer should copy 512 bytes from
the installer's /dev/urandom into the installee's
   /var/lib/systemd/random-seed

Discussion: The newly installed system relies on that file
to initialize its random number generator. It might have
other ways of initializing, or it might not. An improperly
initialized RNG creates grave security problems.

There is no imaginable downside to doing this.

Remark: The Debian installer handles this better. It gives the
installee a nice
   /var/lib/urandom/random-seed
file with 512 bytes of random content. It does not bother with
   /var/lib/systemd/random-seed
at all.

The Ubuntu installer, in contrast, creates a directory
   /var/lib/urandom
with no contents, i.e. no files at all. Perhaps this is vestigial.
Suggestion: The Ubuntu installer should:
  a) not create that directory at all, or
  b) create /var/lib/urandom/random-seed as a symlink to
         ../systemd/random-seed, or
  c) put the actual data in /var/lib/urandom/random-seed --
   which is the traditional and compatible place for it -- and
   teach the systemd scripts to find it there.

Disclaimer: As a separate matter, it is important to ensure
that the installer system itself has a properly initialized RNG.
There are ways of doing so, but that is a topic for another day.
For present purposes, the point is only that the installer should
not make things worse. It should use whatever randomness it has
to initialize the installee system.

--------------------------------

Observed on a Live CD system:
:; lsb_release -rd
Description: Ubuntu 16.04.1 LTS
Release: 16.04

The package is:
:; apt-cache policy ubiquity
ubiquity:
  Installed: 2.21.63.2
  Candidate: 2.21.63.2
  Version table:
 *** 2.21.63.2 500
        500 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.21.63 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages

Revision history for this message
John Denker (lp-8) wrote :

For perspective, and for a reasonable implementation of the solution, see:
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=679972

information type: Private Security → Public Security
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

I think I did ask about this years ago, when systemd random seed came about. I believe we don't actually use systemd's random seed, and use our own anyway. But this should be double checked.

Revision history for this message
John Denker (lp-8) wrote :

I see the importance is still "undecided". Here is something that may help:

Message from Rich Salz, 12/22/2016 10:06 AM:
> Feel free to quote me:
> This is very important.
[...]
> Rich Salz
> Senior Architect, Akamai Technologies
> Member, OpenSSL Dev Team

High-quality randomly-distributed numbers are needed for every aspect of computer
security, including long-term keys, session keys, nonces, initialization vectors,
ASLR, et cetera.

Newly-installed systems need randomness just as much as other systems.

Revision history for this message
Kevin Wall (kwwall) wrote : Re: [Bug 1651947] Re: installer ought to install a proper random-seed
Download full text (4.5 KiB)

John,

Just wondering what the Tails Linux distro (https://tails.boum.org/)
does in this regard of initial seeding for /dev/urandom from their
Live CD distro. Do you know? Since it is a LOT more common for
people to run (only?) from the Live distro for Tails, having an
unpredictable PRNG stream would arguably more relevant there.

I don't know what I did with my Tails CD (and plus it's probably
several years old), otherwise I'd fire it up and look. But perhaps if
they did it right, maybe we can just point to them for a better
approach. Alternately, if you know where the Ubuntu Live CD "builder"
script(s) are, maybe the better approach is to just make a Git pull
request and associate it with this bug report. If they had a fix in-hand
or one they could copy from, then I think this would be more likely to
change the importance from "undecided" to at least Low, or maybe
Medium/ (I doubt it will ever be seen more important than that, assuming
they use a H, M, L scale.) It might even get assigned to someone in that
case too.

-kevin

On Fri, Dec 23, 2016 at 2:03 PM, John Denker <email address hidden> wrote:
> I see the importance is still "undecided". Here is something that may
> help:
>
> Message from Rich Salz, 12/22/2016 10:06 AM:
>> Feel free to quote me:
>> This is very important.
> [...]
>> Rich Salz
>> Senior Architect, Akamai Technologies
>> Member, OpenSSL Dev Team
>
> High-quality randomly-distributed numbers are needed for every aspect of computer
> security, including long-term keys, session keys, nonces, initialization vectors,
> ASLR, et cetera.
>
> Newly-installed systems need randomness just as much as other systems.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1651947
>
> Title:
> installer ought to install a proper random-seed
>
> Status in livecd-rootfs package in Ubuntu:
> New
> Status in ubiquity package in Ubuntu:
> New
>
> Bug description:
> Observed behavior: The Ubuntu "Live CD" installer creates
> a file on the installee (i.e. target) filesystem called
> /var/lib/systemd/random-seed
> but alas it has zero length.
>
> Desired behavior: The installer should copy 512 bytes from
> the installer's /dev/urandom into the installee's
> /var/lib/systemd/random-seed
>
> Discussion: The newly installed system relies on that file
> to initialize its random number generator. It might have
> other ways of initializing, or it might not. An improperly
> initialized RNG creates grave security problems.
>
> There is no imaginable downside to doing this.
>
> Remark: The Debian installer handles this better. It gives the
> installee a nice
> /var/lib/urandom/random-seed
> file with 512 bytes of random content. It does not bother with
> /var/lib/systemd/random-seed
> at all.
>
> The Ubuntu installer, in contrast, creates a directory
> /var/lib/urandom
> with no contents, i.e. no files at all. Perhaps this is vestigial.
> Suggestion: The Ubuntu installer should:
> a) not create that directory at all, or
> b) create /var/lib/urandom/random-seed as a symlink to
> ../syst...

Read more...

Revision history for this message
Colin Watson (cjwatson) wrote :

I haven't worked on the installer much for a while, but just a note in passing: it's quite common for even fixed bugs to still have importance undecided, because it just means that nobody did the (in some cases, busy-)work of setting that field. I've set it just to keep people happy, but I would suggest not spending too many electrons worrying about that part of things.

Changed in ubiquity (Ubuntu):
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in livecd-rootfs (Ubuntu):
status: New → Confirmed
Changed in ubiquity (Ubuntu):
status: New → Confirmed
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

/var/lib/urandom/random-seed is used by /etc/init.d/urandom; however under systemd, urandom.service is an alias for systemd-random-seed. The location of the random seed is configurable in systemd, however the default is /var/lib/systemd/random-seed. IMHO, it makes sense to transition to /var/lib/systemd/random-seed throughout the installers & booting.

Changed in ubiquity (Ubuntu):
assignee: nobody → Dimitri John Ledkov (xnox)
milestone: none → ubuntu-17.03
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

It appears that this was fixed on 2016-02-24. In Bug #1523199. I will mark this bug report as a duplicate.

Could you please clarify which installation media/releases are you using?

Changed in livecd-rootfs (Ubuntu):
status: Confirmed → Invalid
Changed in ubiquity (Ubuntu):
milestone: ubuntu-17.03 → none
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.