summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2017-05-04 22:47:28 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2017-05-04 22:47:28 +0000
commit9fc7e677e42f5451f933614238ec5d4f5de5ac92 (patch)
tree9b4686a23a7d5213709edfd6fd463393db10b7af /sys/kern
parent57587e34afae8d0caadcfdf23e2df5eed363538a (diff)
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')
-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