summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_disk.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2017-05-04 22:47:27 +0000
committerderaadt <deraadt@openbsd.org>2017-05-04 22:47:27 +0000
commitd40269aff7aa0cf551de8ebbb8ea6dc0e8a786c9 (patch)
treed360dad83b7ddd423dca45f3cd22614addad5503 /sys/kern/subr_disk.c
parentAdd IPsec test for manually configured SA bundles. That does ipcomp, (diff)
downloadwireguard-openbsd-d40269aff7aa0cf551de8ebbb8ea6dc0e8a786c9.tar.xz
wireguard-openbsd-d40269aff7aa0cf551de8ebbb8ea6dc0e8a786c9.zip
Also pass the blk offset to disk_unbusy(), so that it can pass it to
the random subsystem as entropy. This value is pretty much unknown, and anyways our entropy input ring does not saturate from knowns. ok mikeb djm
Diffstat (limited to 'sys/kern/subr_disk.c')
-rw-r--r--sys/kern/subr_disk.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index 4d220feeae0..07783b57002 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.229 2017/04/20 14:13:00 visa Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.230 2017/05/04 22:47:27 deraadt Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -1245,7 +1245,7 @@ disk_busy(struct disk *diskp)
* time, and reset the timestamp.
*/
void
-disk_unbusy(struct disk *diskp, long bcount, int read)
+disk_unbusy(struct disk *diskp, long bcount, daddr_t blkno, int read)
{
struct timeval dv_time, diff_time;
@@ -1273,7 +1273,8 @@ disk_unbusy(struct disk *diskp, long bcount, int read)
mtx_leave(&diskp->dk_mtx);
- add_disk_randomness(bcount ^ diff_time.tv_usec);
+ add_disk_randomness(bcount ^ diff_time.tv_usec ^
+ (blkno >> 32) ^ (blkno & 0xffffffff));
}
int