Remove the Yarrow PRNG algorithm option in accordance with due noticegiven in random(4).This includes updating of the relevant man pages, and no-longer-usedharvesting parameters.Ensure that the
Remove the Yarrow PRNG algorithm option in accordance with due noticegiven in random(4).This includes updating of the relevant man pages, and no-longer-usedharvesting parameters.Ensure that the pseudo-unit-test still does something useful, now alsowith the "other" algorithm instead of Yarrow.PR: 230870Reviewed by: cemApproved by: so(delphij,gtetlow)Approved by: re(marius)Differential Revision: https://reviews.freebsd.org/D16898
show more ...
glxsb: Convert remaining OCF driver to new interfaceglxsb, an i386 AMD Geode specific driver, was missed in r336439. Correct thatmistake and adapt it to the new interface as well.X-MFC-with: 33
glxsb: Convert remaining OCF driver to new interfaceglxsb, an i386 AMD Geode specific driver, was missed in r336439. Correct thatmistake and adapt it to the new interface as well.X-MFC-with: 336439
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - error
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.
Huge cleanup of random(4) code.* 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 rand
Huge cleanup of random(4) code.* 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/D2025Reviewed by: vsevolod,delphij,rwatson,trasz,jmgApproved by: so (delphij)
CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenyears for head. However, it is continuously misused as the mpsafe argumentfor callout_init(9). Deprecate the flag and cle
CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenyears for head. However, it is continuously misused as the mpsafe argumentfor callout_init(9). Deprecate the flag and clean up callout_init() callsto make them more consistent.Differential Revision: https://reviews.freebsd.org/D2613Reviewed by: jhbMFC after: 2 weeks
This is the much-discussed major upgrade to the random(4) device, known to you all as /dev/random.This code has had an extensive rewrite and a good series of reviews, both by the author and other p
This is the much-discussed major upgrade to the random(4) device, known to 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)
Snapshot. This passes the build test, but has not yet been finished or debugged.Contains:* Refactor the hardware RNG CPU instruction sources to feed intothe software mixer. This is unfinished. T
Snapshot. This passes the build test, but has not yet been finished or debugged.Contains:* Refactor the hardware RNG CPU instruction sources to feed intothe software mixer. This is unfinished. The actual harvesting needsto be sorted out. Modified by me (see below).* Remove 'frac' parameter from random_harvest(). This was neverused and adds extra code for no good reason.* Remove device write entropy harvesting. This provided a weakattack vector, was not very good at bootstrapping the device. Tofollow will be a replacement explicit reseed knob.* Separate out all the RANDOM_PURE sources into separate harvestentities. This adds some secuity in the case where more than oneis present.* Review all the code and fix anything obviously messy or inconsistent.Address som review concerns while I'm here, like rename the pseudo-rngto 'dummy'.Submitted by: Arthur Mesh <[email protected]> (the first item)
Yarrow wants entropy estimations to be conservative; the usual ideais that if you are certain you have N bits of entropy, you declareN/2.
More conversions of drivers to use the PCI parent DMA tag.
Fix two possible (but unlikely) NULL-pointer dereferences in glxsb(4).Spotted by: CoverityMFC after: 1 week
- Convert sc_sessions_mtx mutex to a rwlock, so in the fast path (glxsb_process()) we don't block others when looking for our session.- Simplify the loop responsible for freeing sessions on detach
- Convert sc_sessions_mtx mutex to a rwlock, so in the fast path (glxsb_process()) we don't block others when looking for our session.- Simplify the loop responsible for freeing sessions on detach.- No need to drop a lock around malloc(M_NOWAIT).- Treat ses_used as boolean.- Avoid gotos where possible.- Various style(9) fixes.Reviewed by: philip, Patrick Lamaiziere <[email protected]>
Add glxsb(4) driver for the Security Block in AMD Geode LX processors (asfound in Soekris hardware, for instance). The hardware supports accelerationof AES-128-CBC accessible through crypto(4) and
Add glxsb(4) driver for the Security Block in AMD Geode LX processors (asfound in Soekris hardware, for instance). The hardware supports accelerationof AES-128-CBC accessible through crypto(4) and supplies entropy to random(4).TODO: o Implement rndtest(4) support o Performance enhancementsSubmitted by: Patrick Lamaizière <patfbsd -at- davenulle.org>Reviewed by: jhb, samMFC after: 1 week