Home | History | Annotate | Download | only in kern
History log of /src/sys/kern/kern_uuid.c
RevisionDateAuthorComments
 1.20  05-Oct-2014  riastradh Get arguments in the right order for copyout. (Oops!)
 1.19  04-Oct-2014  riastradh Make uuidgen(2) generate v4 (random) uuids.

Rip out all the needless MAC address and date/time leakage. No more
uuid_init necessary, nor contention over a global uuid state.

While here, simplify uuid_snprintf and fix a strict aliasing
violation.
 1.18  19-Nov-2011  tls branches: 1.18.8;
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.
 1.17  04-May-2010  kardel branches: 1.17.8;
switch to nanotime() for 100ns resolution
 1.16  18-Nov-2008  joerg branches: 1.16.6; 1.16.8;
Make uuidgen available for the kernel.
 1.15  02-Jul-2008  matt branches: 1.15.2; 1.15.4;
Switch from KASSERT to CTASSERT for those asserts testing sizes of types.
 1.14  19-Apr-2008  plunky branches: 1.14.2; 1.14.4; 1.14.6;
correct cut and paste error in uuid_dec_be(); le16dec -> be16dec
 1.13  07-Jan-2008  ad branches: 1.13.6; 1.13.8;
Hold kernel_lock across IFNET_FOREACH().
 1.12  20-Dec-2007  dsl Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.11  26-Aug-2007  dyoung branches: 1.11.2; 1.11.8; 1.11.10; 1.11.14;
Constify: LLADDR -> CLLADDR. I'm aiming here to make it easier to
identify sockaddr_dl abuse that remains in the kernel, especially
the potential for overwriting memory past the end of a sockaddr_dl
with, e.g., memcpy(LLADDR(), ...).

Use sockaddr_dl_setaddr() in a few places.
 1.10  09-Jul-2007  ad branches: 1.10.2; 1.10.6;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.9  09-Feb-2007  ad branches: 1.9.6; 1.9.8;
Merge newlock2 to head.
 1.8  01-Nov-2006  yamt remove some __unused from function parameters.
 1.7  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.6  11-Dec-2005  christos branches: 1.6.20; 1.6.22;
merge ktrace-lwp.
 1.5  29-May-2005  christos branches: 1.5.2;
- add const.
- remove unnecessary casts.
- add __UNCONST casts and mark them with XXXUNCONST as necessary.
 1.4  24-Jan-2005  matt Add IFNET_FOREACH and IFADDR_FOREACH macros and start using them.
 1.3  12-Sep-2004  thorpej branches: 1.3.4;
Move the 16/32-bit encode/decode to/from octet stream routines from
kern_uuid.c to sys/endian.h (where FreeBSD has them), and add 64-bit
variants.
 1.2  30-Aug-2004  thorpej - Define a constant to describe the length of a printed UUID string.
- Clean up the namespace of this module and enable the encode/decode
functions and printing functions.
- Move the code that actually generates the UUID out of the system call
routine and into its own function.
 1.1  29-Jan-2004  tsarna branches: 1.1.4;
uuidgen(2) syscall. Originally from FreeBSD, ported by John Franklin in
PR#23470, with minor updates by me. This is only the syscall support
from that PR, for now.

Changes: port over fix from FreeBSD for multicast address generation.
Changed bcopy to memcpy. For now, #ifdef notyet the portions of
kern_uuid.c that are meant to be used by (currently nonexistent) other
things in the kernel. Added syscall to COMPAT_FREEBSD as well, though
that's currently not useful, as any program new enough to use this call
also uses other syscalls we don't (yet) emulate.
 1.1.4.7  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.4.6  04-Feb-2005  skrll Sync with HEAD.
 1.1.4.5  21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.4  18-Sep-2004  skrll Sync with HEAD.
 1.1.4.3  03-Sep-2004  skrll Sync with HEAD
 1.1.4.2  03-Aug-2004  skrll Sync with HEAD
 1.1.4.1  29-Jan-2004  skrll file kern_uuid.c was added on branch ktrace-lwp on 2004-08-03 10:52:54 +0000
 1.3.4.1  29-Apr-2005  kent sync with -current
 1.5.2.3  21-Jan-2008  yamt sync with head
 1.5.2.2  03-Sep-2007  yamt sync with head.
 1.5.2.1  26-Feb-2007  yamt sync with head.
 1.6.22.2  10-Dec-2006  yamt sync with head.
 1.6.22.1  22-Oct-2006  yamt sync with head
 1.6.20.1  30-Jan-2007  ad Remove support for SA. Ok core@.
 1.9.8.1  11-Jul-2007  mjf Sync with head.
 1.9.6.2  09-Oct-2007  ad Sync with head.
 1.9.6.1  21-Mar-2007  ad - Replace more simple_locks, and fix up in a few places.
- Use condition variables.
- LOCK_ASSERT -> KASSERT.
 1.10.6.1  03-Sep-2007  jmcneill Sync with HEAD.
 1.10.2.1  03-Sep-2007  skrll Sync with HEAD.
 1.11.14.2  08-Jan-2008  bouyer Sync with HEAD
 1.11.14.1  02-Jan-2008  bouyer Sync with HEAD
 1.11.10.1  26-Dec-2007  ad Sync with head.
 1.11.8.1  18-Feb-2008  mjf Sync with HEAD.
 1.11.2.1  09-Jan-2008  matt sync with HEAD
 1.13.8.1  18-May-2008  yamt sync with head.
 1.13.6.3  17-Jan-2009  mjf Sync with HEAD.
 1.13.6.2  02-Jul-2008  mjf Sync with HEAD.
 1.13.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.14.6.1  03-Jul-2008  simonb Sync with head.
 1.14.4.3  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.14.4.2  14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.14.4.1  10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.14.2.2  11-Aug-2010  yamt sync with head.
 1.14.2.1  04-May-2009  yamt sync with head.
 1.15.4.1  19-Jan-2009  skrll Sync with HEAD.
 1.15.2.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.16.8.1  30-May-2010  rmind sync with head
 1.16.6.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.17.8.1  17-Apr-2012  yamt sync with head
 1.18.8.1  03-Dec-2017  jdolecek update from HEAD

RSS XML Feed