rndtest: clean up empty lines in .c and .h files
Remove FreeBSD 4 support
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that arestill not MPSAFE (or already are but aren’t properly mark
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that arestill not MPSAFE (or already are but aren’t properly marked).Use it in preparation for a general review of all nodes.This is non-functional change that adds annotations to SYSCTL_NODE andSYSCTL_PROC nodes using one of the soon-to-be-required flags.Mark all obvious cases as MPSAFE. All entries that haven't been markedas MPSAFE before are by default marked as NEEDGIANTApproved by: kib (mentor, blanket)Commented by: kib, gallatin, melifaroDifferential Revision: https://reviews.freebsd.org/D23718
show more ...
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
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.
sys: use our nitems() macro when param.h is available.This should cover all the remaining cases in the kernel.Discussed in: freebsd-current
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
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.
- Correct mispellings of the word occurrenceSubmitted by: Christoph Mallon <[email protected]> (via private mail)
Revert previous commit...Pointyhat to: kevlo (myself)
Prefer NULL over 0 for pointers
Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.The SYSCTL_NODE macro defines a list that stores all child-elements ofthat node. If there's no SYSCTL_DECL macro anywhere else,
Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.The SYSCTL_NODE macro defines a list that stores all child-elements ofthat node. If there's no SYSCTL_DECL macro anywhere else, there's noreason why it shouldn't be static.
Start each of the license/copyright comments with /*-, minor shuffle of lines
Use __FBSDID().Also some minor style cleanups.
Change instances of callout_init that specify MPSAFE behaviour touse CALLOUT_MPSAFE instead of "1" for the second parameter. Thisdoes not change the behaviour; it just makes the intent more clear.
o correct mib spelling: reset -> retesto add #ifdef's needed to share code directly with -stable
FIPS 140-2 rng data tester for h/w crypto devices. This driver periodicallymonitors the entropy data harvested by crypto drivers to verify it complieswith FIPS 140-2. If data fails any test then
FIPS 140-2 rng data tester for h/w crypto devices. This driver periodicallymonitors the entropy data harvested by crypto drivers to verify it complieswith FIPS 140-2. If data fails any test then the driver discards it andcommences continuous testing of harvested data until it is deemed ok.Results are collected in a statistics block and, optionally, reported onthe console. In normal use the overhead associated with this driver isnot noticeable.Note that drivers must (currently) be compiled specially to enable use.Obtained from: original code by Jason L. Wright