urandom startup script initializes poolsize with incorrect value

Bug #947041 reported by Kasper Dupont
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
sysvinit (Debian)
Fix Released
Unknown
sysvinit (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

/etc/init.d/urandom compares the size of the saved pool in /var/lib/urandom/random-seed with the current value in /proc/sys/kernel/random/poolsize and updates the poolsize if it is too small. But when updating poolsize it uses the old value rather than the new value.

Btw. The comment saying:
        # Hm, why is the saved pool re-created at boot? [pere 2009-09-03]
should be replaced with:
        # The saved pool re-created at boot to ensure successive boots will use a different random seed, even if the system did not shut down cleanly.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: initscripts 2.87dsf-4ubuntu17.4
ProcVersionSignature: Ubuntu 2.6.32-37.81-generic 2.6.32.49+drm33.21
Uname: Linux 2.6.32-37-generic i686
Architecture: i386
Date: Mon Mar 5 12:02:10 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 10.04.3 LTS "Lucid Lynx" - Release i386 (20110720.1)
ProcEnviron:
 PATH=(custom, user)
 LANG=en_DK.utf8
 SHELL=/bin/bash
SourcePackage: sysvinit

Related branches

Revision history for this message
Kasper Dupont (ubuntu-launchpad-feb) wrote :
Revision history for this message
Kasper Dupont (ubuntu-launchpad-feb) wrote :

I noticed another bug in the same script. The two calls of dd to save the seed during boot and shutdown will truncate the pool before writing new data. This will cause a small time window during which the seed only exists in RAM and not on permanent storage. If the system was to crash or lose power during that time window, all the entropy collected since the system was first installed would be lost. Using conv=notrunc would avoid this problem.

Revision history for this message
Simon Déziel (sdeziel) wrote :

John Denker provided many patches for the urandom init script. All of them were integrated in version sysvinit (2.88dsf-23) which is not ship in any Ubuntu version (not even in Raring).

IMHO, this bug should be set to high importance because having a good random seed is important for many cryptographic operations.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in sysvinit (Ubuntu):
status: New → Confirmed
Simon Déziel (sdeziel)
Changed in sysvinit (Ubuntu):
status: Confirmed → Fix Committed
Changed in sysvinit (Debian):
status: Unknown → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (31.3 KiB)

This bug was fixed in the package sysvinit - 2.88dsf-41ubuntu1

---------------
sysvinit (2.88dsf-41ubuntu1) saucy; urgency=low

  * Merge from Debian unstable:
    - fixes typo in /lib/init/vars.sh. LP: #1146047.
  * Remaining changes:
    - Remove various initscripts (and an ifupdown hook) that have been
      replaced by upstart jobs shipped in other packages.
    - debian/sysvinit-utils.links: Compat symlink from /usr/bin/service to
      /usr/sbin/service
    - If /var/run/init.upgraded exists, call telinit u before unmounting
      the root filesystem.
    - Support Cell processor:
      + debian/initscripts.postinst: Create spu system group and /spu mount
        point if we are running on a Cell processor.
      + debian/control: Add initscripts dependency 'passwd' for groupadd.
    - debian/patches/91_sulogin_lockedpw.dpatch: Disable "root account is
      locked" warning, since this is the default in Ubuntu. Document this in
      sulogin.8.
    - debian/patches/92_sulogin_support_static_sh.patch: add support for
      /bin/static-sh as fallback if the regular shell fails to execute
    - debian/control: Drop Essential: yes from packages since we use Upstart.
    - debian/control: Do not build the sysvinit binary package any more. It
      conflicts with upstart, which is required, so it is uninstallable.
    - remove debian/postinst: this is supposed to go into the sysvinit
      package in Debian, but we don't ship that.
    - debian/control: sysvinit-utils recommends the upstart that provides
      the reload action
    - Mark all binary packages as Multi-Arch: foreign to allow for upstart
      to be installable with multi-arch (needed for armhf containers on x86)
    - Add a versioned depends to initscripts of mountall (>= 2.28), since
      everything else depends on initscripts for /run and the boot-time
      implementation is in mountall for us.
    - Drop /etc/default/tmpfs, and drop mention of it from
      debian/src/initscripts/man/rcS.5.
    - Added debian/src/initscripts/etc/init.d/ondemand: Sleep for 60 seconds,
      then set CPU Frequency Scaling governor to "ondemand" (or to
      "interactive" on systems that support it).
    - Remove mention of RAMLOCK, RAMSHM, and RAMTMP from the rcS(5) manual
      page.
    - When /dev/shm and /run/shm are both directories (not mounts), make
      /dev/shm a symlink to /run/shm.
    - d/service/service: Use 'stop/start' instead of passing restart
      directly through to upstart.
    - d/service/service.8: Document handling of upstart jobs.
    - Fix documentation for other things handled by mountall instead of
      initscripts: tmpfs, /sys (mountall lets you specify options in
      /etc/fstab), and ASYNCMOUNTNFS.
    - debian/src/initscripts/etc/init.d/sendsigs:
      + sendsigs: OMITPIDS needs to be reinitalized for every loop iteration
        before concatenating pids of upstart jobs to it.
      + only omit jobs that are in the 'start' goal or that are in state
        'stop/killed'. Those that are destined for 'stop' are waited on and
        killed like all other processes.
      + make report_unkillable use apport instead of echoing to console; but
        disable...

Changed in sysvinit (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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