summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2016-05-23 15:48:57 +0000
committerderaadt <deraadt@openbsd.org>2016-05-23 15:48:57 +0000
commit97dabd714b1d459e292db282ed3d9f695fe62b33 (patch)
tree6e7b76d0d841982187f53a36a604ddb3f88285c0 /sys
parentMove some code around. (diff)
downloadwireguard-openbsd-97dabd714b1d459e292db282ed3d9f695fe62b33.tar.xz
wireguard-openbsd-97dabd714b1d459e292db282ed3d9f695fe62b33.zip
remove the sysctl kern.random counters, since none of the remaining
ones are capable of giving valuable works vs does-not-work evidence. ok tedu
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/rnd.c13
-rw-r--r--sys/dev/rndvar.h20
-rw-r--r--sys/sys/sysctl.h6
3 files changed, 5 insertions, 34 deletions
diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c
index 83583764426..83d14d8374f 100644
--- a/sys/dev/rnd.c
+++ b/sys/dev/rnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rnd.c,v 1.180 2016/05/17 21:05:49 tedu Exp $ */
+/* $OpenBSD: rnd.c,v 1.181 2016/05/23 15:48:59 deraadt Exp $ */
/*
* Copyright (c) 2011 Theo de Raadt.
@@ -230,7 +230,6 @@ struct rand_event {
u_int rnd_event_idx;
struct timeout rnd_timeout;
-struct rndstats rndstats;
u_int32_t entropy_pool[POOLWORDS] __attribute__((section(".openbsd.randomdata")));
u_int entropy_add_ptr;
@@ -377,11 +376,6 @@ enqueue_randomness(u_int state, u_int val)
rep->re_time += ts.tv_nsec ^ (ts.tv_sec << 20);
rep->re_val += val;
- rndstats.rnd_enqs++;
- rndstats.rnd_ed[nbits]++;
- rndstats.rnd_sc[state]++;
- rndstats.rnd_sb[state] += nbits;
-
if (rnd_qlen() > QEVSLOW/2 && timeout_initialized(&rnd_timeout) &&
!timeout_pending(&rnd_timeout))
timeout_add(&rnd_timeout, 1);
@@ -454,7 +448,6 @@ dequeue_randomness(void *v)
if (timeout_initialized(&rnd_timeout))
timeout_del(&rnd_timeout);
- rndstats.rnd_deqs++;
while ((rep = rnd_get())) {
buf[0] = rep->re_time;
buf[1] = rep->re_val;
@@ -464,7 +457,6 @@ dequeue_randomness(void *v)
add_entropy_words(buf, 2);
mtx_enter(&entropylock);
- rndstats.rnd_total += nbits;
}
mtx_leave(&entropylock);
}
@@ -598,7 +590,6 @@ _rs_stir(int do_lock)
if (do_lock)
mtx_enter(&rndlock);
_rs_seed(buf, sizeof(buf));
- rndstats.arc4_nstirs++;
if (do_lock)
mtx_leave(&rndlock);
@@ -681,7 +672,6 @@ arc4random(void)
mtx_enter(&rndlock);
_rs_random_u32(&ret);
- rndstats.arc4_reads += sizeof(ret);
mtx_leave(&rndlock);
return ret;
}
@@ -694,7 +684,6 @@ arc4random_buf(void *buf, size_t n)
{
mtx_enter(&rndlock);
_rs_random_buf(buf, n);
- rndstats.arc4_reads += n;
mtx_leave(&rndlock);
}
diff --git a/sys/dev/rndvar.h b/sys/dev/rndvar.h
index 3eac8ab1c91..98b70e8919a 100644
--- a/sys/dev/rndvar.h
+++ b/sys/dev/rndvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rndvar.h,v 1.37 2016/05/17 21:05:49 tedu Exp $ */
+/* $OpenBSD: rndvar.h,v 1.38 2016/05/23 15:48:59 deraadt Exp $ */
/*
* Copyright (c) 1996,2000 Michael Shalayeff.
@@ -41,25 +41,7 @@
#define RND_SRC_VIDEO 7
#define RND_SRC_NUM 8
-struct rndstats {
- quad_t rnd_total; /* total bits of entropy generated */
- quad_t rnd_used; /* strong data bits read so far */
- quad_t arc4_reads; /* aRC4 data bytes read so far */
- quad_t arc4_nstirs; /* arc4 pool stirs */
-
- quad_t rnd_enqs; /* enqueue calls */
- quad_t rnd_deqs; /* dequeue calls */
- quad_t rnd_drops; /* queue-full drops */
- quad_t rnd_drople; /* queue low watermark low entropy drops */
-
- quad_t rnd_ed[32]; /* entropy feed distribution */
- quad_t rnd_sc[RND_SRC_NUM]; /* add* calls */
- quad_t rnd_sb[RND_SRC_NUM]; /* add* bits */
-};
-
#ifdef _KERNEL
-extern struct rndstats rndstats;
-
#define add_true_randomness(d) enqueue_randomness(RND_SRC_TRUE, (int)(d))
#define add_timer_randomness(d) enqueue_randomness(RND_SRC_TIMER, (int)(d))
#define add_mouse_randomness(d) enqueue_randomness(RND_SRC_MOUSE, (int)(d))
diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h
index 9410fce465e..9f01bc20c50 100644
--- a/sys/sys/sysctl.h
+++ b/sys/sys/sysctl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.h,v 1.161 2016/05/10 01:33:03 deraadt Exp $ */
+/* $OpenBSD: sysctl.h,v 1.162 2016/05/23 15:48:57 deraadt Exp $ */
/* $NetBSD: sysctl.h,v 1.16 1996/04/09 20:55:36 cgd Exp $ */
/*
@@ -131,7 +131,7 @@ struct ctlname {
#define KERN_SOMAXCONN 28 /* int: listen queue maximum */
#define KERN_SOMINCONN 29 /* int: half-open controllable param */
#define KERN_USERMOUNT 30 /* int: users may mount filesystems */
-#define KERN_RND 31 /* struct: rnd(4) statistics */
+/* was KERN_RND 31 */
#define KERN_NOSUIDCOREDUMP 32 /* int: no setuid coredumps ever */
#define KERN_FSYNC 33 /* int: file synchronization support */
#define KERN_SYSVMSG 34 /* int: SysV message queue suppoprt */
@@ -152,7 +152,7 @@ struct ctlname {
#define KERN_POOL 49 /* struct: pool information */
#define KERN_STACKGAPRANDOM 50 /* int: stackgap_random */
#define KERN_SYSVIPC_INFO 51 /* struct: SysV sem/shm/msg info */
-/* was KERN_USERCRYPTO 52 */
+/* was KERN_USERCRYPTO 52 */
/* was KERN_CRYPTODEVALLOWSOFT 53 */
#define KERN_SPLASSERT 54 /* int: splassert */
#define KERN_PROC_ARGS 55 /* node: proc args and env */