NetBSD/sys
tls cd114adca5 This commit includes two major changes:
1) Speed up arc4random().  We make arc4randbyte() inline, which makes this
   not much slower than, say, the other arc4 implementation in our kernel.

   We also replace four calls to arc4randbyte() with a loop, saving about
   20% on some processors where the "unrolled" arc4randbyte() calls would
   needlessly stomp the cache.

2) Address various problems with the initialization/"stirring" code,
   primarily in the area of handling of the source data from the kernel
   entropy pool.  We used to:

	a) Ask the entropy pool for 32 bytes

	b) If we got zero bytes, key with junk from the stack (ouch!)
	   which has some nasty implications, to say the least.  For
	   example, we're most likely to get zero bytes at boot time,
	   when the stack contents are even more predictable than usual.

	c) If we got less than 32 bytes but more than zero bytes, use
	   however many bytes we got as the arc4 key, copying it
	   repeatedly as per usual arc4 key setup.

	   Because of the way NetBSD's entropy pool works, this was
	   mostly harmless, because if you ask for RND_EXTRACT_ANY,
	   you always get as many bytes as you ask for.  However,
	   this is probably a security hole in the original FreeBSD
	   code, where AFAICT you might end up using an 8-bit arc4
	   key -- not good, much worse than using the output of the
	   entropy pool hash function even when it thinks it only
	   has 8 bits of entropy to give you.

	   One thing this code could do on NetBSD that was not so
	   good was to replace a key with a lot of entropy with
	   one with less entropy.  That's clearly counterproductive.

   The new code, instead:

	a) Asks for 32 good bytes.  If it gets them, use them as the
	   arc4 key in the usual way.

	b) Tracks how many entropy bytes the key it's replacing had.
	   If the new entropy request got less bytes, leave the old
	   key in place.  Note that the first time through, the "old
	   key" had zero bytes, so we'll always replace it.

	c) If we get less then 32 bytes but more than we had, request
	   EXTRACT_ANY bytes from the entropy pool, padding the key
	   out to 32 bytes which we then use as the arc4 key in the
	   usual way.

This is still really all rather backwards.  Instead of this generator
deciding to rekey itself using a basically arbitrary metric, it should
register a callback so that the entropy pool code could rekey it when
a lot of bits were available.  Details at 11.

Finally, rename the "stir" function (which did not stir) to "rekey",
which is what it actually does.
2002-10-06 06:47:40 +00:00
..
adosfs Fix biff in previous change. 2002-09-21 20:26:49 +00:00
altq pull only "opt_altq_enabled.h" in if_altq.h, and include altqconf.h 2002-09-22 20:09:15 +00:00
arch regen from GENERIC.in 2002-10-06 03:00:02 +00:00
coda remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
compat Added uname emulation so that IRIX's uname -s returns IRIX 2002-10-05 23:17:29 +00:00
conf Back out revision 1.23, it breaks all kernel configs that do 2002-10-06 00:07:17 +00:00
crypto Modified to avoid compiler warnings. The specific warning related 2002-09-08 07:52:41 +00:00
ddb Another item on the TODO list: 2002-08-26 11:35:22 +00:00
dev Add a missing RF_LOCK_MUTEX(). 2002-10-06 05:32:59 +00:00
filecorefs Fix biff in previous change. 2002-09-21 20:26:49 +00:00
fs MNT_GETARGS support 2002-09-21 18:10:34 +00:00
gdbscripts Build a .gdbinit in the kernel build directory. The new .gdbinit 2002-09-01 23:04:47 +00:00
ipkdb
isofs MNT_GETARGS support 2002-09-21 18:10:34 +00:00
kern count executable image pages as executable for vm-usage purposes. 2002-10-05 22:34:02 +00:00
lib This commit includes two major changes: 2002-10-06 06:47:40 +00:00
lkm make this compile. 2002-09-06 16:56:13 +00:00
miscfs remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
msdosfs remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
net Perform as a bridge within the AP for HostAP mode, to allow communication 2002-10-04 04:25:05 +00:00
netatalk
netccitt "definitions" has lots of 'i's, but that's not reason to leave one out. 2002-09-29 23:23:56 +00:00
netinet Remove unused ipl_usec. 2002-09-29 17:55:14 +00:00
netinet6 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
netisdn remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
netiso
netkey port spec is not permitted to tunnel mode policy, as we don't reassemble 2002-10-04 05:45:22 +00:00
netnatm
netns remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
netsmb remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
nfs forgot to set deadthresh; thanks to YAMAMOTO Takashi. 2002-10-01 15:00:04 +00:00
ntfs remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
stand
sys count executable image pages as executable for vm-usage purposes. 2002-10-05 22:34:02 +00:00
ufs Add support for the Apple UFS variation on ffs 2002-09-28 20:11:05 +00:00
uvm Garbage collect some leftover (and unneeded) code. OK'ed by chs. 2002-10-05 17:26:06 +00:00
Makefile