diff options
author | 2016-05-23 15:48:57 +0000 | |
---|---|---|
committer | 2016-05-23 15:48:57 +0000 | |
commit | 97dabd714b1d459e292db282ed3d9f695fe62b33 (patch) | |
tree | 6e7b76d0d841982187f53a36a604ddb3f88285c0 | |
parent | Move some code around. (diff) | |
download | wireguard-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
-rw-r--r-- | sbin/sysctl/sysctl.c | 36 | ||||
-rw-r--r-- | sys/dev/rnd.c | 13 | ||||
-rw-r--r-- | sys/dev/rndvar.h | 20 | ||||
-rw-r--r-- | sys/sys/sysctl.h | 6 |
4 files changed, 6 insertions, 69 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index ae537907659..72799f652d8 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysctl.c,v 1.213 2016/05/04 19:48:08 jca Exp $ */ +/* $OpenBSD: sysctl.c,v 1.214 2016/05/23 15:48:59 deraadt Exp $ */ /* $NetBSD: sysctl.c,v 1.9 1995/09/30 07:12:50 thorpej Exp $ */ /* @@ -167,7 +167,6 @@ int Aflag, aflag, nflag, qflag; #define BOOTTIME 0x00000002 #define CHRDEV 0x00000004 #define BLKDEV 0x00000008 -#define RNDSTATS 0x00000010 #define BADDYNAMIC 0x00000020 #define BIOSGEO 0x00000040 #define BIOSDEV 0x00000080 @@ -395,9 +394,6 @@ parse(char *string, int flags) case KERN_BOOTTIME: special |= BOOTTIME; break; - case KERN_RND: - special |= RNDSTATS; - break; case KERN_HOSTID: case KERN_ARND: special |= UNSIGNED; @@ -859,36 +855,6 @@ parse(char *string, int flags) } return; } - if (special & RNDSTATS) { - struct rndstats *rndstats = (struct rndstats *)buf; - int i; - - if (!nflag) - (void)printf("%s%s", string, equ); - printf("tot: %llu used: %llu read: %llu stirs: %llu" - " enqs: %llu deqs: %llu drops: %llu ledrops: %llu", - rndstats->rnd_total, rndstats->rnd_used, - rndstats->arc4_reads, rndstats->arc4_nstirs, - rndstats->rnd_enqs, rndstats->rnd_deqs, - rndstats->rnd_drops, rndstats->rnd_drople); - printf(" ed:"); - for (i = 0; - i < sizeof(rndstats->rnd_ed)/sizeof(rndstats->rnd_ed[0]); - i++) - printf(" %llu", (unsigned long long)rndstats->rnd_ed[i]); - printf(" sc:"); - for (i = 0; - i < sizeof(rndstats->rnd_sc)/sizeof(rndstats->rnd_sc[0]); - i++) - printf(" %llu", (unsigned long long)rndstats->rnd_sc[i]); - printf(" sb:"); - for (i = 0; - i < sizeof(rndstats->rnd_sb)/sizeof(rndstats->rnd_sb[0]); - i++) - printf(" %llu", (unsigned long long)rndstats->rnd_sb[i]); - printf("\n"); - return; - } if (special & BADDYNAMIC) { u_int port, lastport; u_int32_t *baddynamic = (u_int32_t *)buf; 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 */ |