| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
Approved by: so (implicit)
Notes:
svn path=/head/; revision=301735
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a warning that occurs in a number of files that use the
random_harvest_queue function.
Differential Revision: https://reviews.freebsd.org/D4229
Submitted by: stevek@juniper.net
Reviewed by: markm
Approved by: so
Notes:
svn path=/head/; revision=301713
|
| |
|
|
|
|
|
|
|
|
| |
(one manual change to fix grammar)
Confirmed With: db
Approved by: secteam (not really, but this is a comment typo fix)
Notes:
svn path=/head/; revision=300050
|
| |
|
|
|
|
|
|
|
|
| |
No functional change.
Reviewed by: markm
Approved by: so
Notes:
svn path=/head/; revision=298923
|
| |
|
|
|
|
|
|
|
|
|
| |
While here also use howmany() macro from sys/param.h
No functional change.
Reviewed by: markm (roundup replacement part)
Approved by: so
Notes:
svn path=/head/; revision=298593
|
| |
|
|
|
|
|
|
|
|
| |
loadable when not compiled into the kernel.
Approved by: so (delphij)
Sponsored by: The FreeBSD Foundation
Notes:
svn path=/head/; revision=298102
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a no-op currently, but in kernels with earlier AP startup, the
random kthread was trying to use timeouts with sleeps before timers are
working. Wait until SI_SUB_KICK_SCHEDULER to start the random kproc.
Reviewed by: delphij, imp, markm
Approved by: so
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D5712
Notes:
svn path=/head/; revision=297366
|
| |
|
|
|
|
|
|
| |
Found by: PVS-Studio
Approved by: so (implicit)
Notes:
svn path=/head/; revision=295718
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
cperciva's libmd implementation is 5-30% faster
The same was done for SHA256 previously in r263218
cperciva's implementation was lacking SHA-384 which I implemented, validated against OpenSSL and the NIST documentation
Extend sbin/md5 to create sha384(1)
Chase dependancies on sys/crypto/sha2/sha2.{c,h} and replace them with sha512{c.c,.h}
Reviewed by: cperciva, des, delphij
Approved by: secteam, bapt (mentor)
MFC after: 2 weeks
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D3929
Notes:
svn path=/head/; revision=292782
|
| |
|
|
|
|
|
|
| |
Submitted by: jenkins
Approved by: so (/dev/random blanket)
Notes:
svn path=/head/; revision=288780
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'rdrand' instruction may occasionally not return random numbers, in
spite of looping attempts to do so. The reusult is a KASSERT/panic.
Reluctantly accept this state-of-affairs, but make a noise about it.
if this 'noise' spams the console, it may be time to discontinue
using that source.
This is written in a general way to account for /any/ source that
might not supply random numbers when required.
Submitted by: jkh (report and slightly different fix)
Approved by: so (/dev/random blanket)
Notes:
svn path=/head/; revision=288703
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
wanted".
Provide and document the RANDOM_ENABLE_UMA option.
Change RANDOM_FAST to RANDOM_UMA to clarify the harvesting.
Remove RANDOM_DEBUG option, replace with SDT probes. These will be of
use to folks measuring the harvesting effect when deciding whether to
use RANDOM_ENABLE_UMA.
Requested by: scottl and others.
Approved by: so (/dev/random blanket)
Differential Revision: https://reviews.freebsd.org/D3197
Notes:
svn path=/head/; revision=287023
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
if desired.
Retire randomdev_none.c and introduce random_infra.c for resident
infrastructure. Completely stub out random(4) calls in the "without
DEV_RANDOM" case.
Add RANDOM_LOADABLE option to allow loadable Yarrow/Fortuna/LocallyWritten
algorithm. Add a skeleton "other" algorithm framework for folks
to add their own processing code. NIST, anyone?
Retire the RANDOM_DUMMY option.
Build modules for Yarrow, Fortuna and "other".
Use atomics for the live entropy rate-tracking.
Convert ints to bools for the 'seeded' logic.
Move _write() function from the algorithm-specific areas to randomdev.c
Get rid of reseed() function - it is unused.
Tidy up the opt_*.h includes.
Update documentation for random(4) modules.
Fix test program (reviewers, please leave this).
Differential Revision: https://reviews.freebsd.org/D3354
Reviewed by: wblock,delphij,jmg,bjk
Approved by: so (/dev/random blanket)
Notes:
svn path=/head/; revision=286839
|
| |
|
|
|
|
|
|
|
| |
pointy hat.
Approved by: so (/dev/random blanket)
Notes:
svn path=/head/; revision=285700
|
| |
|
|
|
|
|
| |
Approved by: so (/dev/random blanket)
Notes:
svn path=/head/; revision=285693
|
| |
|
|
|
|
|
|
|
| |
console warning spamming while blocked.
Approved by: so (/dev/random blanket)
Notes:
svn path=/head/; revision=285692
|
| |
|
|
|
|
|
| |
Approved by: so (/dev/random blanket)
Notes:
svn path=/head/; revision=285690
|
| |
|
|
|
|
|
|
|
|
|
|
| |
I performed the commit on a different system as where I wrote the
change. After pulling in the change from Phabricator, I didn't notice
that a single chunk did not apply.
Approved by: secteam (implicit, as intended change was approved)
Pointy hat to: me
Notes:
svn path=/head/; revision=285573
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The random_get() system call works similar to getentropy()/getrandom()
on OpenBSD/Linux. It fills a buffer with random data.
This change introduces a new function, read_random_uio(), that is used
to implement read() on the random devices. We can call into this
function from within the CloudABI compatibility layer.
Approved by: secteam
Reviewed by: jmg, markm, wblock
Obtained from: https://github.com/NuxiNL/freebsd
Differential Revision: https://reviews.freebsd.org/D3053
Notes:
svn path=/head/; revision=285549
|
| |
|
|
|
|
|
|
|
|
|
| |
in units of crypto blocks, so must have adequate space to write.
This means needing to be careful about buffers and keeping track
of external read request length.
Approved by: so (/dev/random blanket)
Notes:
svn path=/head/; revision=285439
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Tweek man page.
- Remove all mention of RANDOM_FORTUNA. If the system owner wants YARROW or DUMMY, they ask for it, otherwise they get FORTUNA.
- Tidy up headers a bit.
- Tidy up declarations a bit.
- Make static in a couple of places where needed.
- Move Yarrow/Fortuna SYSINIT/SYSUNINIT to randomdev.c, moving us towards a single file where the algorithm context is used.
- Get rid of random_*_process_buffer() functions. They were only used in one place each, and are better subsumed into those places.
- Remove *_post_read() functions as they are stubs everywhere.
- Assert against buffer size illegalities.
- Clean up some silly code in the randomdev_read() routine.
- Make the harvesting more consistent.
- Make some requested argument name changes.
- Tidy up and clarify a few comments.
- Make some requested comment changes.
- Make some requested macro changes.
* NOTE: the thing calling itself a 'unit test' is not yet a proper
unit test, but it helps me ensure things work. It may be a proper
unit test at some time in the future, but for now please don't make
any assumptions or hold any expectations.
Differential Revision: https://reviews.freebsd.org/D2025
Approved by: so (/dev/random blanket)
Notes:
svn path=/head/; revision=285422
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* GENERAL
- Update copyright.
- Make kernel options for RANDOM_YARROW and RANDOM_DUMMY. Set
neither to ON, which means we want Fortuna
- If there is no 'device random' in the kernel, there will be NO
random(4) device in the kernel, and the KERN_ARND sysctl will
return nothing. With RANDOM_DUMMY there will be a random(4) that
always blocks.
- Repair kern.arandom (KERN_ARND sysctl). The old version went
through arc4random(9) and was a bit weird.
- Adjust arc4random stirring a bit - the existing code looks a little
suspect.
- Fix the nasty pre- and post-read overloading by providing explictit
functions to do these tasks.
- Redo read_random(9) so as to duplicate random(4)'s read internals.
This makes it a first-class citizen rather than a hack.
- Move stuff out of locked regions when it does not need to be
there.
- Trim RANDOM_DEBUG printfs. Some are excess to requirement, some
behind boot verbose.
- Use SYSINIT to sequence the startup.
- Fix init/deinit sysctl stuff.
- Make relevant sysctls also tunables.
- Add different harvesting "styles" to allow for different requirements
(direct, queue, fast).
- Add harvesting of FFS atime events. This needs to be checked for
weighing down the FS code.
- Add harvesting of slab allocator events. This needs to be checked for
weighing down the allocator code.
- Fix the random(9) manpage.
- Loadable modules are not present for now. These will be re-engineered
when the dust settles.
- Use macros for locks.
- Fix comments.
* src/share/man/...
- Update the man pages.
* src/etc/...
- The startup/shutdown work is done in D2924.
* src/UPDATING
- Add UPDATING announcement.
* src/sys/dev/random/build.sh
- Add copyright.
- Add libz for unit tests.
* src/sys/dev/random/dummy.c
- Remove; no longer needed. Functionality incorporated into randomdev.*.
* live_entropy_sources.c live_entropy_sources.h
- Remove; content moved.
- move content to randomdev.[ch] and optimise.
* src/sys/dev/random/random_adaptors.c src/sys/dev/random/random_adaptors.h
- Remove; plugability is no longer used. Compile-time algorithm
selection is the way to go.
* src/sys/dev/random/random_harvestq.c src/sys/dev/random/random_harvestq.h
- Add early (re)boot-time randomness caching.
* src/sys/dev/random/randomdev_soft.c src/sys/dev/random/randomdev_soft.h
- Remove; no longer needed.
* src/sys/dev/random/uint128.h
- Provide a fake uint128_t; if a real one ever arrived, we can use
that instead. All that is needed here is N=0, N++, N==0, and some
localised trickery is used to manufacture a 128-bit 0ULLL.
* src/sys/dev/random/unit_test.c src/sys/dev/random/unit_test.h
- Improve unit tests; previously the testing human needed clairvoyance;
now the test will do a basic check of compressibility. Clairvoyant
talent is still a good idea.
- This is still a long way off a proper unit test.
* src/sys/dev/random/fortuna.c src/sys/dev/random/fortuna.h
- Improve messy union to just uint128_t.
- Remove unneeded 'static struct fortuna_start_cache'.
- Tighten up up arithmetic.
- Provide a method to allow eternal junk to be introduced; harden
it against blatant by compress/hashing.
- Assert that locks are held correctly.
- Fix the nasty pre- and post-read overloading by providing explictit
functions to do these tasks.
- Turn into self-sufficient module (no longer requires randomdev_soft.[ch])
* src/sys/dev/random/yarrow.c src/sys/dev/random/yarrow.h
- Improve messy union to just uint128_t.
- Remove unneeded 'staic struct start_cache'.
- Tighten up up arithmetic.
- Provide a method to allow eternal junk to be introduced; harden
it against blatant by compress/hashing.
- Assert that locks are held correctly.
- Fix the nasty pre- and post-read overloading by providing explictit
functions to do these tasks.
- Turn into self-sufficient module (no longer requires randomdev_soft.[ch])
- Fix some magic numbers elsewhere used as FAST and SLOW.
Differential Revision: https://reviews.freebsd.org/D2025
Reviewed by: vsevolod,delphij,rwatson,trasz,jmg
Approved by: so (delphij)
Notes:
svn path=/head/; revision=284959
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
temporary buffer when remaining space is not enough to hold
a whole block.
- yarrow.c: add a comment that we intend to change the code and remove
memcpy's in the future. (*)
Requested by: markm (*)
Reviewed by: markm
Approved by: so (self)
Notes:
svn path=/head/; revision=278950
|
| |
|
|
|
|
|
|
|
|
|
|
| |
causing ZFS panics on boot...
This is purely reviewed and tested by peter.
Reviewed by: peter
Approved by: so (implicit), peter
Notes:
svn path=/head/; revision=278927
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
randomdev_init_reader to change read_random over to the newly installed
adaptor was missed. This means both read_random and arc4random (seeded
from read_random) were not returning very random data. This also
effects userland arc4random as it is seeded from kernel arc4random.
The random devices are uneffected and have returned good randomness
since the change.
All keys generated with a kernel of r273872 must be regenerated with
a kernel with this patch. Keys generated may be predictable.
Remove the warning as log is too early to print anything, and it would
always get printed due to early use of arc4random...
Reviewed by: delphij, markm
Approved by: so (delphij)
Notes:
svn path=/head/; revision=278907
|
| |
|
|
|
|
|
|
|
| |
Noted by: dim
Approved by: secteam (des)
MFC after: 4 days
Notes:
svn path=/head/; revision=274381
|
| |
|
|
|
|
|
|
|
| |
update the Fortuna code to use SHAd-256 as defined in FS&K.
Approved by: so (self)
Notes:
svn path=/head/; revision=274340
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Remove duplicated sources between standard part of the kernel and
module. In particular, it caused duplicated lock initialization and
sysctl registration, both having bad consequences.
- Add missed source files to module.
- Static part of the kernel provides randomdev module, not
random_adaptors. Correct dependencies.
- Use cdev modules declaration macros.
Approved by: secteam (delphij)
Reviewed by: markm
Notes:
svn path=/head/; revision=274252
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
buffer from asm to C, which reduces amount of arguments for inline asm
and simplifies constraints. Use unsigned types consistently.
Submitted by: bde
Approved by: secteam (delphij)
Reviewed by: markm
MFC after: 1 week
Notes:
svn path=/head/; revision=274250
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
some accumulated entropy twice and use that as the new key. Due to a
typo, we were using the output of the first hash round instead of the
second. Correct this, but eliminate temp[] since we can reuse hash[].
Also add comments explaining what is going on and why.
Noticed by: Sami Farin <sami.farin@gmail.com>
Reviewed by: markm@
Approved by: so (des)
Notes:
svn path=/head/; revision=274103
|
| |
|
|
|
|
|
|
|
| |
Reported by: many
Pointy hat to: delphij (for not testing the commit with WITNESS)
Approved by: so
Notes:
svn path=/head/; revision=274006
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
random_adaptors_lock is held.
- Use sx_sleep instead of tsleep in read and write path to allow
another thread that registers a new random adapter when waiting.
Assert that random_adaptor is not NULL after reacquiring the lock.
- Capture EINTR/ERESTART from sx_sleep to allow the blocking cycle be
stopped when user requests so, while there also make short
read/write's return 0.
- Move M_WAITOK allocations out of lock scope.
In collobration with: kib, markm, ian, jilles
Reviewed by: kib, markm
Approved by: so
Notes:
svn path=/head/; revision=273997
|
| |
|
|
|
|
|
|
|
| |
immediately before kick_init.
Approved by: so (self)
Notes:
svn path=/head/; revision=273958
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
you all as /dev/random.
This code has had an extensive rewrite and a good series of reviews, both by the author and other parties. This means a lot of code has been simplified. Pluggable structures for high-rate entropy generators are available, and it is most definitely not the case that /dev/random can be driven by only a hardware souce any more. This has been designed out of the device. Hardware sources are stirred into the CSPRNG (Yarrow, Fortuna) like any other entropy source. Pluggable modules may be written by third parties for additional sources.
The harvesting structures and consequently the locking have been simplified. Entropy harvesting is done in a more general way (the documentation for this will follow). There is some GREAT entropy to be had in the UMA allocator, but it is disabled for now as messing with that is likely to annoy many people.
The venerable (but effective) Yarrow algorithm, which is no longer supported by its authors now has an alternative, Fortuna. For now, Yarrow is retained as the default algorithm, but this may be changed using a kernel option. It is intended to make Fortuna the default algorithm for 11.0. Interested parties are encouraged to read ISBN 978-0-470-47424-2 "Cryptography Engineering" By Ferguson, Schneier and Kohno for Fortuna's gory details. Heck, read it anyway.
Many thanks to Arthur Mesh who did early grunt work, and who got caught in the crossfire rather more than he deserved to.
My thanks also to folks who helped me thresh this out on whiteboards and in the odd "Hallway track", or otherwise.
My Nomex pants are on. Let the feedback commence!
Reviewed by: trasz,des(partial),imp(partial?),rwatson(partial?)
Approved by: so(des)
Notes:
svn path=/head/; revision=273872
|
| |
|
|
|
|
|
|
|
| |
Submitted by: grehan@
Approved by: so@ (des)
MFC after: 1 month
Notes:
svn path=/head/; revision=273027
|
| |
|
|
|
|
|
|
|
|
|
| |
Generator (DRNG) Software Implementation Guide.
Reviewed by: kib
Approved by: so
MFC after: 2 weeks
Notes:
svn path=/head/; revision=267984
|
| |
|
|
|
|
|
| |
Approved by: security-officer(des)
Notes:
svn path=/head/; revision=264969
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
rather than just void *.
Then, as part of this, convert a couple of mbuf m->m_data accesses
to mtod(m, const void *).
Reviewed by: markm
Approved by: security-officer (delphij)
Sponsored by: Netflix, Inc.
Notes:
svn path=/head/; revision=257525
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
harvester, which now always calls hwrngs with the buffer length
multiple of the word size. This allows to remove the excessive memory
accesses to temporary buffer when saving the entropy word.
Streamline the assembly and unify it between i386 and amd64.
Reviewed by: markm, des
Approved by: so (des)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Notes:
svn path=/head/; revision=256670
|
| |
|
|
| |
Notes:
svn path=/projects/random_number_generator/; revision=256400
|
| |
|
|
|
|
|
|
|
|
|
|
| |
to dummy,yarrow and break the usability of /dev/random.
Fix the name of the tunable to something logical that 'sysctl kern.random'
emits.
Submitted by: des@ (the idea, code by me)
Notes:
svn path=/projects/random_number_generator/; revision=256399
|
| |
|
|
| |
Notes:
svn path=/projects/random_number_generator/; revision=256346
|
| |
|
|
|
|
|
| |
others.
Notes:
svn path=/projects/random_number_generator/; revision=256254
|
| |
|
|
|
|
|
|
| |
Rename YARROW_RNG and FORTUNA_RNG to RANDOM_YARROW and RANDOM_FORTUNA.
Add the RANDOM_* options to LINT.
Notes:
svn path=/projects/random_number_generator/; revision=256240
|
| |
|
|
| |
Notes:
svn path=/projects/random_number_generator/; revision=256205
|
| |
|
|
| |
Notes:
svn path=/projects/random_number_generator/; revision=256204
|
| |
|
|
|
|
|
| |
really needs to do.
Notes:
svn path=/projects/random_number_generator/; revision=256203
|
| |
|
|
| |
Notes:
svn path=/projects/random_number_generator/; revision=256184
|
| |
|
|
| |
Notes:
svn path=/projects/random_number_generator/; revision=256183
|
| |
|
|
|
|
|
| |
implementation namespace.
Notes:
svn path=/projects/random_number_generator/; revision=256182
|