summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorBret Lambert <blambert@cvs.openbsd.org>2013-04-24 08:31:07 +0000
committerBret Lambert <blambert@cvs.openbsd.org>2013-04-24 08:31:07 +0000
commite6d151cfc0936be5a5f780959d71b0a30a26d2ac (patch)
tree15a050a4ac74e26ff734012ed2a4df2b051b4b85 /sys/kern
parent34233fd0b370968c82f37cd6516f0694394946dc (diff)
When attaching disks, feed the disklabel's checksum to
the random pool as unique-esque-but-not-secret data. inspired by conversations with tedu@/deraadt@ ok deraadt@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_disk.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index b8b47b17f31..0ff3cda9e8d 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.147 2013/02/17 17:39:29 miod Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.148 2013/04/24 08:31:06 blambert Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -886,8 +886,10 @@ disk_attach_callback(void *arg1, void *arg2)
goto done;
/* Read disklabel. */
- if (disk_readlabel(&dl, dev, errbuf, sizeof(errbuf)) == NULL)
+ if (disk_readlabel(&dl, dev, errbuf, sizeof(errbuf)) == NULL) {
+ add_timer_randomness(dl.d_checksum);
dk->dk_flags |= DKF_LABELVALID;
+ }
done:
dk->dk_flags |= DKF_OPENED;