freebsd-skq/etc
markm 70d85b1cf3 Merge from project branch via main. Uninteresting commits are trimmed.
Refactor of /dev/random device. Main points include:

* Userland seeding is no longer used. This auto-seeds at boot time
on PC/Desktop setups; this may need some tweeking and intelligence
from those folks setting up embedded boxes, but the work is believed
to be minimal.

* An entropy cache is written to /entropy (even during installation)
and the kernel uses this at next boot.

* An entropy file written to /boot/entropy can be loaded by loader(8)

* Hardware sources such as rdrand are fed into Yarrow, and are no
longer available raw.

------------------------------------------------------------------------
r256240 | des | 2013-10-09 21:14:16 +0100 (Wed, 09 Oct 2013) | 4 lines

Add a RANDOM_RWFILE option and hide the entropy cache code behind it.
Rename YARROW_RNG and FORTUNA_RNG to RANDOM_YARROW and RANDOM_FORTUNA.
Add the RANDOM_* options to LINT.

------------------------------------------------------------------------
r256239 | des | 2013-10-09 21:12:59 +0100 (Wed, 09 Oct 2013) | 2 lines

Define RANDOM_PURE_RNDTEST for rndtest(4).

------------------------------------------------------------------------
r256204 | des | 2013-10-09 18:51:38 +0100 (Wed, 09 Oct 2013) | 2 lines

staticize struct random_hardware_source

------------------------------------------------------------------------
r256203 | markm | 2013-10-09 18:50:36 +0100 (Wed, 09 Oct 2013) | 2 lines

Wrap some policy-rich code in 'if NOTYET' until we can thresh out
what it really needs to do.

------------------------------------------------------------------------
r256184 | des | 2013-10-09 10:13:12 +0100 (Wed, 09 Oct 2013) | 2 lines

Re-add /dev/urandom for compatibility purposes.

------------------------------------------------------------------------
r256182 | des | 2013-10-09 10:11:14 +0100 (Wed, 09 Oct 2013) | 3 lines

Add missing include guards and move the existing ones out of the
implementation namespace.

------------------------------------------------------------------------
r256168 | markm | 2013-10-08 23:14:07 +0100 (Tue, 08 Oct 2013) | 10 lines

Fix some just-noticed problems:

o Allow this to work with "nodevice random" by fixing where the
MALLOC pool is defined.

o Fix the explicit reseed code. This was correct as submitted, but
in the project branch doesn't need to set the "seeded" bit as this
is done correctly in the "unblock" function.

o Remove some debug ifdeffing.

o Adjust comments.

------------------------------------------------------------------------
r256159 | markm | 2013-10-08 19:48:11 +0100 (Tue, 08 Oct 2013) | 6 lines

Time to eat crow for me.

I replaced the sx_* locks that Arthur used with regular mutexes;
this turned out the be the wrong thing to do as the locks need to
be sleepable. Revert this folly.

# Submitted by:	Arthur Mesh <arthurmesh@gmail.com> (In original diff)

------------------------------------------------------------------------
r256138 | des | 2013-10-08 12:05:26 +0100 (Tue, 08 Oct 2013) | 10 lines

Add YARROW_RNG and FORTUNA_RNG to sys/conf/options.

Add a SYSINIT that forces a reseed during proc0 setup, which happens
fairly late in the boot process.

Add a RANDOM_DEBUG option which enables some debugging printf()s.

Add a new RANDOM_ATTACH entropy source which harvests entropy from the
get_cyclecount() delta across each call to a device attach method.

------------------------------------------------------------------------
r256135 | markm | 2013-10-08 07:54:52 +0100 (Tue, 08 Oct 2013) | 8 lines

Debugging. My attempt at EVENTHANDLER(multiuser) was a failure; use
EVENTHANDLER(mountroot) instead.

This means we can't count on /var being present, so something will
need to be done about harvesting /var/db/entropy/... .

Some policy now needs to be sorted out, and a pre-sync cache needs
to be written, but apart from that we are now ready to go.

Over to review.

------------------------------------------------------------------------
r256094 | markm | 2013-10-06 23:45:02 +0100 (Sun, 06 Oct 2013) | 8 lines

Snapshot.

Looking pretty good; this mostly works now. New code includes:

* Read cached entropy at startup, both from files and from loader(8)
preloaded entropy. Failures are soft, but announced. Untested.

* Use EVENTHANDLER to do above just before we go multiuser. Untested.

------------------------------------------------------------------------
r256088 | markm | 2013-10-06 14:01:42 +0100 (Sun, 06 Oct 2013) | 2 lines

Fix up the man page for random(4). This mainly removes no-longer-relevant
details about HW RNGs, reseeding explicitly and user-supplied
entropy.

------------------------------------------------------------------------
r256087 | markm | 2013-10-06 13:43:42 +0100 (Sun, 06 Oct 2013) | 6 lines

As userland writing to /dev/random is no more, remove the "better
than nothing" bootstrap mode.

Add SWI harvesting to the mix.

My box seeds Yarrow by itself in a few seconds! YMMV; more to follow.

------------------------------------------------------------------------
r256086 | markm | 2013-10-06 13:40:32 +0100 (Sun, 06 Oct 2013) | 11 lines

Debug run. This now works, except that the "live" sources haven't
been tested. With all sources turned on, this unlocks itself in
a couple of seconds! That is no my box, and there is no guarantee
that this will be the case everywhere.

* Cut debug prints.

* Use the same locks/mutexes all the way through.

* Be a tad more conservative about entropy estimates.

------------------------------------------------------------------------
r256084 | markm | 2013-10-06 13:35:29 +0100 (Sun, 06 Oct 2013) | 5 lines

Don't use the "real" assembler mnemonics; older compilers may not
understand them (like when building CURRENT on 9.x).

# Submitted by:	Konstantin Belousov <kostikbel@gmail.com>

------------------------------------------------------------------------
r256081 | markm | 2013-10-06 10:55:28 +0100 (Sun, 06 Oct 2013) | 12 lines

SNAPSHOT.

Simplify the malloc pools; We only need one for this device.

Simplify the harvest queue.

Marginally improve the entropy pool hashing, making it a bit faster
in the process.

Connect up the hardware "live" source harvesting. This is simplistic
for now, and will need to be made rate-adaptive.

All of the above passes a compile test but needs to be debugged.

------------------------------------------------------------------------
r256042 | markm | 2013-10-04 07:55:06 +0100 (Fri, 04 Oct 2013) | 25 lines

Snapshot. This passes the build test, but has not yet been finished or debugged.

Contains:

* Refactor the hardware RNG CPU instruction sources to feed into
the software mixer. This is unfinished. The actual harvesting needs
to be sorted out. Modified by me (see below).

* Remove 'frac' parameter from random_harvest(). This was never
used and adds extra code for no good reason.

* Remove device write entropy harvesting. This provided a weak
attack vector, was not very good at bootstrapping the device. To
follow will be a replacement explicit reseed knob.

* Separate out all the RANDOM_PURE sources into separate harvest
entities. This adds some secuity in the case where more than one
is present.

* Review all the code and fix anything obviously messy or inconsistent.
Address som review concerns while I'm here, like rename the pseudo-rng
to 'dummy'.

# Submitted by:	Arthur Mesh <arthurmesh@gmail.com> (the first item)

------------------------------------------------------------------------
r255319 | markm | 2013-09-06 18:51:52 +0100 (Fri, 06 Sep 2013) | 4 lines

Yarrow wants entropy estimations to be conservative; the usual idea
is that if you are certain you have N bits of entropy, you declare
N/2.

------------------------------------------------------------------------
r255075 | markm | 2013-08-30 18:47:53 +0100 (Fri, 30 Aug 2013) | 4 lines

Remove short-lived idea; thread to harvest (eg) RDRAND enropy into the
usual harvest queues. It was a nifty idea, but too heavyweight.

# Submitted by:	Arthur Mesh <arthurmesh@gmail.com>

------------------------------------------------------------------------
r255071 | markm | 2013-08-30 12:42:57 +0100 (Fri, 30 Aug 2013) | 4 lines

Separate out the Software RNG entropy harvesting queue and thread
into its own files.

# Submitted by:	 Arthur Mesh <arthurmesh@gmail.com>

------------------------------------------------------------------------
r254934 | markm | 2013-08-26 20:07:03 +0100 (Mon, 26 Aug 2013) | 2 lines

Remove the short-lived namei experiment.

------------------------------------------------------------------------
r254928 | markm | 2013-08-26 19:35:21 +0100 (Mon, 26 Aug 2013) | 2 lines

Snapshot; Do some running repairs on entropy harvesting. More needs
to follow.

------------------------------------------------------------------------
r254927 | markm | 2013-08-26 19:29:51 +0100 (Mon, 26 Aug 2013) | 15 lines

Snapshot of current work;

1) Clean up namespace; only use "Yarrow" where it is Yarrow-specific
or close enough to the Yarrow algorithm. For the rest use a neutral
name.

2) Tidy up headers; put private stuff in private places. More could
be done here.

3) Streamline the hashing/encryption; no need for a 256-bit counter;
128 bits will last for long enough.

There are bits of debug code lying around; these will be removed
at a later stage.

------------------------------------------------------------------------
r254784 | markm | 2013-08-24 14:54:56 +0100 (Sat, 24 Aug 2013) | 39 lines

1) example (partially humorous random_adaptor, that I call "EXAMPLE")
 * It's not meant to be used in a real system, it's there to show how
   the basics of how to create interfaces for random_adaptors. Perhaps
   it should belong in a manual page

2) Move probe.c's functionality in to random_adaptors.c
 * rename random_ident_hardware() to random_adaptor_choose()

3) Introduce a new way to choose (or select) random_adaptors via tunable
"rngs_want" It's a list of comma separated names of adaptors, ordered
by preferences. I.e.:
rngs_want="yarrow,rdrand"

Such setting would cause yarrow to be preferred to rdrand. If neither of
them are available (or registered), then system will default to
something reasonable (currently yarrow). If yarrow is not present, then
we fall back to the adaptor that's first on the list of registered
adaptors.

4) Introduce a way where RNGs can play a role of entropy source. This is
mostly useful for HW rngs.

The way I envision this is that every HW RNG will use this
functionality by default. Functionality to disable this is also present.
I have an example of how to use this in random_adaptor_example.c (see
modload event, and init function)

5) fix kern.random.adaptors from
kern.random.adaptors: yarrowpanicblock
to
kern.random.adaptors: yarrow,panic,block

6) add kern.random.active_adaptor to indicate currently selected
adaptor:
root@freebsd04:~ # sysctl kern.random.active_adaptor
kern.random.active_adaptor: yarrow

# Submitted by:	Arthur Mesh <arthurmesh@gmail.com>

Submitted by:	Dag-Erling Smørgrav <des@FreeBSD.org>, Arthur Mesh <arthurmesh@gmail.com>
Reviewed by:	des@FreeBSD.org
Approved by:	re (delphij)
Approved by:	secteam (des,delphij)
2013-10-12 15:31:36 +00:00
..
bluetooth
defaults Merge from project branch via main. Uninteresting commits are trimmed. 2013-10-12 15:31:36 +00:00
devd Regenerate after recent addition of FTDI and bluetooth device IDs. 2013-09-01 14:28:12 +00:00
etc.amd64 Remove unneeded mappings from libmap32.conf. Move it up one level and 2013-09-09 06:02:30 +00:00
etc.arm Remove the reference to pseudo-terminals from the description. 2011-03-30 08:22:29 +00:00
etc.i386 Remove the reference to pseudo-terminals from the description. 2011-03-30 08:22:29 +00:00
etc.ia64 Remove the reference to pseudo-terminals from the description. 2011-03-30 08:22:29 +00:00
etc.mips Remove the reference to pseudo-terminals from the description. 2011-03-30 08:22:29 +00:00
etc.pc98 Remove the reference to pseudo-terminals from the description. 2011-03-30 08:22:29 +00:00
etc.powerpc Remove the reference to pseudo-terminals from the description. 2011-03-30 08:22:29 +00:00
etc.sparc64 Remove the reference to pseudo-terminals from the description. 2011-03-30 08:22:29 +00:00
gss
mail Merge a number of changes required to hook up OpenBSM 1.2-alpha2's 2012-12-01 15:11:46 +00:00
mtree MFC 256365 2013-10-12 06:08:18 +00:00
namedb Add empty zones for Shared Address Space (RFC 6598) 2013-08-09 07:57:04 +00:00
pam.d - FreeBSD ships a KDE PAM module in base, but it's missing support for passwordless login (kde-np), 2012-05-30 03:10:22 +00:00
periodic Odds and ends left over from BIND and unnoticed because they didn't 2013-10-01 07:19:23 +00:00
ppp Remove COMPILATIONDATE from the default section. This string is no longer 2010-02-16 01:07:06 +00:00
rc.d Merge from project branch via main. Uninteresting commits are trimmed. 2013-10-12 15:31:36 +00:00
root Remove hack to emulate effective uid and just use the EUID's name in the 2012-12-05 13:56:39 +00:00
sendmail Minor changes to force commit these files so new freebsd*.cf files are 2013-04-21 17:11:45 +00:00
amd.map
apmd.conf
crontab Remove HOME= - this has surprised me several times in the past. 2009-06-14 06:37:19 +00:00
csh.cshrc
csh.login Change the commented msgs examples in profile/csh.login from -f to -q. 2010-05-15 17:49:56 +00:00
csh.logout
ddb.conf
devd.conf Comment cosmetics: capitalize SCSI 2013-03-02 18:08:03 +00:00
devfs.conf Remove example for linking /dev/vga to /dev/ttyv0, this hasn't been 2011-10-27 20:39:20 +00:00
dhclient.conf
disktab 10 years too late add support for "2.88MB 3.5in Extra High Density" 2012-11-02 00:17:30 +00:00
fbtab
freebsd-update.conf Add support for backing up the old kernel when installing a new kernel 2009-08-19 20:47:31 +00:00
ftpusers MFC 256365 2013-10-12 06:08:18 +00:00
gettytab Explicitly specify 'np' so that getty(8) does not simulate even parity on 2012-10-18 22:20:02 +00:00
group MFC 256365 2013-10-12 06:08:18 +00:00
hosts
hosts.allow
hosts.equiv
hosts.lpd
inetd.conf Remove CVS from the base system. 2013-06-15 20:29:07 +00:00
libalias.conf
libmap32.conf Remove unneeded mappings from libmap32.conf. Move it up one level and 2013-09-09 06:02:30 +00:00
libmap.conf Include /usr/local/etc/libmap.d/ by default. 2013-08-01 05:50:42 +00:00
login.access
login.conf Increase the "memorylocked" limit for the "daemon" class. 2013-01-27 21:55:01 +00:00
mac.conf Spelling fixes for etc/ 2012-01-07 16:10:32 +00:00
Makefile MFC 256365 2013-10-12 06:08:18 +00:00
man.alias
master.passwd MFC 256365 2013-10-12 06:08:18 +00:00
minfree
motd pkg_add is no more the default tool, make motd recommand using pkg install instead of pkg_add 2012-10-20 14:54:49 +00:00
netconfig
netstart /etc/netstart: remove invocation of dhclient 2012-01-20 17:25:15 +00:00
network.subr Add support for "vnet jname" argument in ifconfig_IF. The vnet keyword 2013-10-10 07:41:11 +00:00
networks
newsyslog.conf Add syslog(3) support to devd(8). 2013-07-01 21:20:17 +00:00
nls.alias
nscd.conf
nsmb.conf
nsswitch.conf Revert r224760, and enhance the sed patterns from r224659 to comment out 2011-08-10 20:52:02 +00:00
ntp.conf As of r232844 we no longer need the maxpoll 9 workaround. 2012-08-20 18:45:16 +00:00
opieaccess
pccard_ether Not only load pccard_ether settings, also load network settings. This 2012-11-08 20:34:12 +00:00
pf.os Sync pf.os with OpenBSD: 2012-12-10 20:52:52 +00:00
phones
portsnap.conf Now that the portsnap buildbox is generating the raw bits for INDEX-10, 2013-09-26 10:33:15 +00:00
printcap
profile Change the commented msgs examples in profile/csh.login from -f to -q. 2010-05-15 17:49:56 +00:00
protocols Bring /etc/protocols up to date. 2013-05-10 13:57:44 +00:00
rc Refine the "nojail" rc keyword, adding "nojailvnet" for files that don't 2013-05-19 04:10:34 +00:00
rc.bsdextended
rc.firewall Whitespace nit 2012-07-13 06:46:09 +00:00
rc.initdiskless Revert r243228. This commit appears to cause more trouble than 2012-11-21 18:12:28 +00:00
rc.resume wpa_supplicant should be able to reassociate when resuming, so remove a 2013-07-04 07:32:40 +00:00
rc.sendmail
rc.shutdown Refine the "nojail" rc keyword, adding "nojailvnet" for files that don't 2013-05-19 04:10:34 +00:00
rc.subr - Update rc.d/jail to use a jail(8) configuration file instead of 2013-10-10 09:32:27 +00:00
rc.suspend Revert r211288 and move the logic to the acpi_timer itself. 2012-02-08 20:31:42 +00:00
regdomain.xml Add a new 900MHz GSM regulatory SKU for the Xagyl Communications XC900M. 2012-12-07 06:34:46 +00:00
remote
rpc
services Add MySQL port 3306 2012-03-26 11:48:47 +00:00
shells
snmpd.config Add (disabled) sample configuration lines needed to enable snmp_target(3) module 2010-12-20 17:28:15 +00:00
sysctl.conf
syslog.conf Add syslog(3) support to devd(8). 2013-07-01 21:20:17 +00:00
termcap.small Fix termcap entry typo. 2011-02-09 10:06:31 +00:00