all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH 0/1] Improvements to urandom-seed service
@ 2016-06-04  2:56 Leo Famulari
  2016-06-04  2:56 ` [PATCH 1/1] services: urandom-seed: Refresh seed at boot Leo Famulari
  2016-06-04 22:47 ` [PATCH 0/1] Improvements to urandom-seed service Ludovic Courtès
  0 siblings, 2 replies; 3+ messages in thread
From: Leo Famulari @ 2016-06-04  2:56 UTC (permalink / raw)
  To: guix-devel

I read more on the subject of seeding /dev/urandom [0] and I found that
our service should be improved.

We should "refresh" the seed unconditionally in 'start', after we use it
to seed /dev/urandom [1]. This way, if there is no clean shut down, the
next boot does not re-use the same seed. At first boot, this "refreshed"
seed may not be of great quality, since we have not seeded /dev/urandom
yet, but it's better than the possibility of a 2nd boot with no seeding
at all.

This is recommended in the example in random(4) and the Linux code
comments [2]. I missed this before.

Currently, we make sure the seed exists with appropriate permissions
during activation.

If we refresh the seed in 'start', we can ensure it exists before
refreshing it. Since 'stop' also creates the seed file, we might as well
remove the activation code entirely... right? In that case, we also need
to do mkdir-p in 'stop', to be sure.

Your feedback is requested!

[0]
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/char/random.c#n159

[1] This does not happen if the seed file does not exist. With this
patch, the seed file will not exist at first boot until 'start' has
completed.

[2]
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/char/random.c#n202

Leo Famulari (1):
  services: urandom-seed: Refresh seed at boot.

 gnu/services/base.scm | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

-- 
2.8.3

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

end of thread, other threads:[~2016-06-04 22:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-04  2:56 [PATCH 0/1] Improvements to urandom-seed service Leo Famulari
2016-06-04  2:56 ` [PATCH 1/1] services: urandom-seed: Refresh seed at boot Leo Famulari
2016-06-04 22:47 ` [PATCH 0/1] Improvements to urandom-seed service Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

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.