Commit Graph

1477 Commits

Author SHA1 Message Date
tls
8a012bd83f The rnd pseudo-device is not really optional, because it is in the same
source file as the entropy-pool code itself.  Move it to std.  This
will be cleaned up more when I split the sources up as they should be.

This fixes build breaks on several ports.  Thanks to Havard Eidnes for
pointing them out.
2011-11-22 21:25:05 +00:00
tls
3afd44cf08 First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>.  This change includes
the following:

	An initial cleanup and minor reorganization of the entropy pool
	code in sys/dev/rnd.c and sys/dev/rndpool.c.  Several bugs are
	fixed.  Some effort is made to accumulate entropy more quickly at
	boot time.

	A generic interface, "rndsink", is added, for stream generators to
	request that they be re-keyed with good quality entropy from the pool
	as soon as it is available.

	The arc4random()/arc4randbytes() implementation in libkern is
	adjusted to use the rndsink interface for rekeying, which helps
	address the problem of low-quality keys at boot time.

	An implementation of the FIPS 140-2 statistical tests for random
	number generator quality is provided (libkern/rngtest.c).  This
	is based on Greg Rose's implementation from Qualcomm.

	A new random stream generator, nist_ctr_drbg, is provided.  It is
	based on an implementation of the NIST SP800-90 CTR_DRBG by
	Henric Jungheim.  This generator users AES in a modified counter
	mode to generate a backtracking-resistant random stream.

	An abstraction layer, "cprng", is provided for in-kernel consumers
	of randomness.  The arc4random/arc4randbytes API is deprecated for
	in-kernel use.  It is replaced by "cprng_strong".  The current
	cprng_fast implementation wraps the existing arc4random
	implementation.  The current cprng_strong implementation wraps the
	new CTR_DRBG implementation.  Both interfaces are rekeyed from
	the entropy pool automatically at intervals justifiable from best
	current cryptographic practice.

	In some quick tests, cprng_fast() is about the same speed as
	the old arc4randbytes(), and cprng_strong() is about 20% faster
	than rnd_extract_data().  Performance is expected to improve.

	The AES code in src/crypto/rijndael is no longer an optional
	kernel component, as it is required by cprng_strong, which is
	not an optional kernel component.

	The entropy pool output is subjected to the rngtest tests at
	startup time; if it fails, the system will reboot.  There is
	approximately a 3/10000 chance of a false positive from these
	tests.  Entropy pool _input_ from hardware random numbers is
	subjected to the rngtest tests at attach time, as well as the
	FIPS continuous-output test, to detect bad or stuck hardware
	RNGs; if any are detected, they are detached, but the system
	continues to run.

	A problem with rndctl(8) is fixed -- datastructures with
	pointers in arrays are no longer passed to userspace (this
	was not a security problem, but rather a major issue for
	compat32).  A new kernel will require a new rndctl.

	The sysctl kern.arandom() and kern.urandom() nodes are hooked
	up to the new generators, but the /dev/*random pseudodevices
	are not, yet.

	Manual pages for the new kernel interfaces are forthcoming.
2011-11-19 22:51:18 +00:00
agc
a5b83a6434 grab major 203 for the iSCSI communications device (between kernel
driver and /sbin/iscsid)
2011-11-19 16:41:55 +00:00
riz
262c7a9290 Build and install new in-kernel iscsi initiator kernel module and associated
binaries (iscsid, iscsictl) if MKISCSI != no.  Initiator can also be built
into a kernel by adding 'pseudo-device iscsi' in kernel configuration.
2011-11-15 16:50:43 +00:00
martin
b37874ed85 Add missing subr_pcq.c 2011-11-02 09:47:57 +00:00
tron
364c7183d8 Fix build of kernels without filemon(4). 2011-10-15 10:18:24 +00:00
sjg
db4d363da5 Add the plumbing so one could compile filemon(4) into a kernel. 2011-10-15 00:23:08 +00:00
jmcneill
ab747348b5 Install dev/i2c/i2c_io.h and implement the API in the iic(4) driver.
Obsolete the I2C_SCAN option as this can now be done from userland.
2011-10-02 16:39:45 +00:00
jruoho
a179648071 Add a simple cpufreq(9).
This is slightly improved version presented on tech-kern@ with proper
locking and few additional functions, mainly required for ioctl(9)/cpuctl(8).
2011-09-28 10:55:46 +00:00
joerg
41c1da9cfb Allow analyze to work by including bsd.clang-analyze.mk for kernels 2011-09-25 22:26:33 +00:00
jnemeth
a55ee38cee dm(4) uses dk_lookup() from dksubr.c 2011-09-19 08:53:30 +00:00
plunky
f2d8d4c1c1 for multi-cpu machines, cpu_hatch() straddles the init of
__stack_chk_guard, so ensure stack protection is disabled
on x86 architectures (I don't know about other archs)
2011-08-31 20:16:43 +00:00
jmcneill
eb0ad8c7a7 let kernel makefile override *.d targets 2011-08-28 23:15:53 +00:00
bouyer
8282898f08 The loongon2f+cs5526+jmicron PATA->SATA bridge cause an interresting issue:
1) because the CS5536 is not associated with a x86 CPU, interrupts are not
  ack'ed as it expects so interrupts cannot configured as edge-triggered
  (as is expected for a PCIIDE in compat mode)
2) the PATA->SATA bridge ignores the WDC_IDS (interrupt disable bit) so
  the PATA IRQ line gets asserted when resetting or running some polled
  commands. It also wrongly asserts IRQ when the (nonexistent) slave
  device is selected
2) wouldn't be an issue with edge-triggered interrupt because we would
   get a spurious interrupt and continue operation, a new interrupt only shows
   up when the PATA IRQ line goes low and high again. But because of 1),
   we get an unclearable interrupt instead, and the system loops on the
   interrupt handler.

To workaround this, introduce a WDC_NO_IDS compile option which runs
all polled commands (including reset) at splbio() and without sleeps,
so that the controller's interrupt is effectively disabled and
won't be reenabled before the interrupt can be cleared.

The conditions triggering this problem are speficic enough to handle
this via a compile-time option; no need for a run-time (e.g. a
config(9), device property or callback to disable interrupts) solution.
2011-08-27 17:05:57 +00:00
jmcneill
1501db31c9 defflag DEBUG_EXEC 2011-08-26 19:07:13 +00:00
christos
26b068fc42 Remove gcc-4.5 hacks 2011-08-18 02:19:20 +00:00
jmcneill
747111eaaf let md makefile add newvers.sh flags by setting NVFLAGS 2011-08-11 22:37:57 +00:00
joerg
53cc155f3b Restrict -Wno-array-bounds to tulip.c with gcc. 2011-08-09 13:02:53 +00:00
jmcneill
fb95eabd74 modify the dtv device api so hardware drivers can be loaded independently
of the dtv module
2011-08-09 01:42:24 +00:00
rmind
52b220e91d Add kcpuset(9) - a reworked dynamic CPU set implementation for kernel.
Suitable for use during the early boot.  MD and other implementations
should be replaced with this interface.

Discussed on: tech-kern@
2011-08-07 13:33:01 +00:00
christos
44968cba76 Add an implementation of passive serialization as described in expired
US patent 4809168. This is a reader / writer synchronization mechanism,
designed for lock-less read operations.
2011-07-30 17:01:04 +00:00
uebayasi
3abce800c0 Define SYMTAB_SPACE in opt_ksyms.h, not opt_ddbparam.h. Ensure
that ddb(4) code is independent of SYMTAB_SPACE value.
2011-07-28 13:42:16 +00:00
cliff
fb19d2b789 Add support for CFI NOR, using MPC8536DS as initial example.
Only AMD/Fujitsu command set is suported so far.
This is still work in progress, be advised.
2011-07-15 19:19:55 +00:00
jmcneill
76266fe692 include dtv 2011-07-09 14:48:12 +00:00
jmcneill
fa30660c16 reserve char 200 for dtv 2011-07-09 14:47:27 +00:00
mrg
0514da4400 adb_kbd.c and adb_ms.c need -Wno-cast-qual due to sysctl const issue. 2011-07-07 08:47:22 +00:00
mrg
fc8b9ddc0c apply some -Wno-foo to 3 files that are non-trivial to solve, for GCC 4.5. 2011-07-04 13:00:19 +00:00
uch
9255b46fb4 7th Edition(V7) File System support. and NetBSD symbolic-link, socket, FIFO extension. see newfs_v7fs(8). 2011-06-27 11:52:22 +00:00
matt
65bd0920b3 Allow PAX_ASLR to be used by itself. 2011-06-23 23:42:43 +00:00
mrg
8f161cd6d3 remove all the code that supported HAVE_GCC=3. mostly from chuq. 2011-06-20 06:52:36 +00:00
matt
3a0f273eba If dbsym fails, not fail the command, remove the target too so that the
next invokation will try to remake it.
2011-06-17 21:19:42 +00:00
joerg
94dd60a9c3 Don't duplicate -Werror here, bsd.sys.mk already provides it 2011-05-30 03:12:43 +00:00
matt
2a1887ef27 Allow COM_TOLERANCE to be tweakable. If comspeed returns an invalid
rate, don't use that error value to set the speed.
2011-05-28 19:30:19 +00:00
joerg
a216da57a6 Default to -Wno-sign-compare -Wno-pointer-sign for clang.
Push -Wno-array-bounds down to the cases that depend on it.
Selectively disable warnings for 3rd party software or non-trivial
issues to be reviewed later to get clang -Werror to build most of the
tree.
2011-05-26 12:56:24 +00:00
drochner
4bd7f95161 -remove references to crypto/arc4/arc4.* -- the code isn't used
anywhere afaics
 (The confusion comes probably from use of arc4random() at various places,
  but this lives in libkern and doesn't share code with the former.)
-g/c non-implementation of arc4 encryption in swcrypto(4)
-remove special casing of ARC4 in crypto(4) -- the point is that it
 doesn't use an IV, and this fact is made explicit by the new "ivsize"
 property of xforms
2011-05-23 15:37:35 +00:00
joerg
d3630a7492 Reorder flag order to not depend on -Wextra being applied before
-Wno-sign-compare
2011-05-23 13:55:55 +00:00
mrg
45a8ff3bec move KERNHIST stuff much earlier, so drivers can depend upon it. 2011-05-23 06:50:17 +00:00
joerg
abe88b5ff5 Inherit SSP settings from bsd.sys.mk 2011-05-22 20:49:46 +00:00
joerg
188ae306aa Spell --fatal-warnings with two hyphens 2011-05-19 21:24:55 +00:00
joerg
eab53d10cd Add support for source specific AFLAGS and COPTS. 2011-05-17 07:16:02 +00:00
mrg
a852848eef fix the ordering and make UVMHIST enable KERNHIST automatically. 2011-05-17 05:32:31 +00:00
mrg
8169e46991 move and rename the uvm history code out of uvm_stat to "kernhist".
rename "UVMHIST" option to enable the uvm histories.

TODO:
- make UVMHIST properly depend upon KERNHIST
- enable dynamic registration of histories.  this is mostly just
  allocating something in a bitmap, and is only for viewing multiple
  histories in a merged form.


tested on amd64 and sparc64.
2011-05-17 04:18:05 +00:00
jakllsch
7124327c01 Make ${DBSYM} failure fatal. 2011-05-11 16:03:56 +00:00
drochner
9d083d2f9c add "camellia" crypto code, copied from FreeBSD 2011-05-05 17:38:35 +00:00
plunky
676a6668e7 correct comment 2011-04-30 19:21:09 +00:00
joerg
787e55aa29 Remove PECOFF/Win32 emulation. 2011-04-26 16:57:38 +00:00
joerg
e958063324 Remove IRIX emulation 2011-04-26 16:36:40 +00:00
joerg
5aca2679d7 Remove Darwin, MACH and Mach-O support. 2011-04-26 15:51:22 +00:00
rmind
fbc8beae75 Split off parts of vfs_subr.c into vfs_vnode.c and vfs_mount.c modules.
No functional change.  Discussed on tech-kern@.
2011-04-02 04:28:56 +00:00
dyoung
060522dec8 Hide the radix-trie implementation of the forwarding table so that we
will have an easier time replacing it with something different, even if
it is a second radix-trie implementation.

sys/net/route.c and sys/net/rtsock.c no longer operate directly on
radix_nodes or radix_node_heads.

Hopefully this will reduce the temptation to implement multipath or
source-based routing using grotty hacks to the grotty old radix-trie
code, too. :-)
2011-03-31 19:40:51 +00:00