Commit Graph

13 Commits

Author SHA1 Message Date
riastradh
a7f90b2fd2 Fix races in /dev/u?random initialization and accounting.
- Push /dev/random `information-theoretic' accounting into cprng(9).
- Use percpu(9) for the per-CPU CPRNGs.
- Use atomics with correct memory barriers for lazy CPRNG creation.
- Remove /dev/random file kmem grovelling from fstat(1).
2013-07-01 15:22:00 +00:00
riastradh
6290b0987e Rework rndsink(9) abstraction and adapt arc4random(9) and cprng(9).
rndsink(9):
- Simplify API.
- Simplify locking scheme.
- Add a man page.
- Avoid races in destruction.
- Avoid races in requesting entropy now and scheduling entropy later.

Periodic distribution of entropy to sinks reduces the need for the
last one, but this way we don't need to rely on periodic distribution
(e.g., in a future tickless NetBSD).

rndsinks_lock should probably eventually merge with the rndpool lock,
but we'll put that off for now.

cprng(9):
- Make struct cprng_strong opaque.
- Move rndpseudo.c parts that futz with cprng guts to subr_cprng.c.
- Fix kevent locking.  (Is kevent locking documented anywhere?)
- Stub out rump cprng further until we can rumpify rndsink instead.
- Strip code to grovel through struct cprng_strong in fstat.
2013-06-23 02:35:23 +00:00
christos
3d7bb1da45 support printing rnd descriptor info 2012-11-25 15:30:28 +00:00
christos
0548a80ae0 return stuff for ksem 2012-11-25 01:05:49 +00:00
alnsn
4d1ae9a9af Report jit'ed bpf fildes in fstat. 2012-10-27 22:38:07 +00:00
christos
48bd4d9cb5 add all the possible fileops here, and if there is one we know about
print that instead of the passed name.
2011-09-10 18:34:40 +00:00
christos
585ce9eda6 move _KMEMUSER higher! 2009-07-13 21:44:32 +00:00
christos
d96e875904 need _KMEMUSER too. 2009-07-13 21:43:24 +00:00
christos
f73facbc14 sys/mqueue.h needs sys/types.h now 2009-07-13 17:57:35 +00:00
lukem
dadffc77c0 Fix sign-compare issues. 2009-04-12 06:36:12 +00:00
christos
90baf4f26f only print warnings if vflg. 2009-02-26 17:30:51 +00:00
christos
8dd0b4459d handle more types. 2008-07-23 11:59:43 +00:00
christos
380fafb740 a better attempt on printing dtype_misc 2008-07-22 22:58:04 +00:00