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 ...
OpenCrypto: Convert sessions to opaque handles instead of integersTrack session objects in the framework, and pass handles between theframework (OCF), consumers, and drivers. Avoid redundancy and
OpenCrypto: Convert sessions to opaque handles instead of integersTrack session objects in the framework, and pass handles between theframework (OCF), consumers, and drivers. Avoid redundancy and complexity inindividual drivers by allocating session memory in the framework andproviding it to drivers in ::newsession().Session handles are no longer integers with information encoded in varioushigh bits. Use of the CRYPTO_SESID2FOO() macros should be replaced with theappropriate crypto_ses2foo() function on the opaque session handle.Convert OCF drivers (in particular, cryptosoft, as well as myriad others) tothe opaque handle interface. Discard existing session tracking as much aspossible (quick pass). There may be additional code ripe for deletion.Convert OCF consumers (ipsec, geom_eli, krb5, cryptodev) to handle-styleinterface. The conversion is largely mechnical.The change is documented in crypto.9.Inspired byhttps://lists.freebsd.org/pipermail/freebsd-arch/2018-January/018835.html .No objection from: ae (ipsec portion)Reported by: jhb
Remove "HMAC" from <HASH>_HMAC_BLOCK_LEN macro namesThe block size is a property of the underlying hash algorithm, and hasnothing to do with the HMAC construction.No functional change.
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.
safe: quiet -Wtautological-compareCode was testing that an unsigned type was >= 0.Reviewed by: markjApproved by: markj (mentor)Sponsored by: Dell EMC Isilon
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
In order to reduce use of M_EXT outside of the mbuf allocator andsocket-buffer implementations, introduce a return value for MCLGET()(and m_cljget() that underlies it) to allow the caller to avoid
In order to reduce use of M_EXT outside of the mbuf allocator andsocket-buffer implementations, introduce a return value for MCLGET()(and m_cljget() that underlies it) to allow the caller to avoid testingM_EXT itself. Update all callers to use the return value.With this change, very few network device drivers remain aware ofM_EXT; the primary exceptions lie in mbuf-chain pretty printers fordebugging, and in a few cases, custom mbuf and cluster allocationimplementations.NB: This is a difficult-to-test change as it touches many drivers forwhich I don't have physical devices. Instead we've gone for intensivereview, but further post-commit review would definitely be appreciatedto spot errors where changes could not easily be made mechanically,but were largely mechanical in nature.Differential Revision: https://reviews.freebsd.org/D1440Reviewed by: adrian, bz, gnnSponsored by: EMC / Isilon Storage Division
make this compile on arm... bus_size_t is not size_t, and it hasdifferent sizes on different arches...
Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases,don't create a map before calling bus_dmamem_alloc() (such maps wereleaked). It is believed that the extra destroy of the m
Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases,don't create a map before calling bus_dmamem_alloc() (such maps wereleaked). It is believed that the extra destroy of the map was generallyharmless since bus_dmamem_alloc() often uses special maps for whichbus_dmamap_destroy() is a no-op (e.g. on x86).Reviewed by: scottl
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.
Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIcommand register. The lazy BAR allocation code in FreeBSD sometimesdisables this bit when it detects a range conflict, and w
Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIcommand register. The lazy BAR allocation code in FreeBSD sometimesdisables this bit when it detects a range conflict, and will re-enableit on demand when a driver allocates the BAR. Thus, the bit is no longera reliable indication of capability, and should not be checked. Thisresults in the elimination of a lot of code from drivers, and also givesthe opportunity to simplify a lot of drivers to use a helper API to setthe busmaster enable bit.This changes fixes some recent reports of disk controllers and theirassociated drives/enclosures disappearing during boot.Submitted by: jhbReviewed by: jfv, marius, achadd, achimMFC after: 1 day
Mechanically substitute flags from historic mbuf allocator withmalloc(9) flags in sys/dev.
More conversions of drivers to use the PCI parent DMA tag.
- There's no need to overwrite the default device method with the default one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_
- There's no need to overwrite the default device method with the default one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) since r52045) but even recently added device drivers do this unnecessarily. Discussed with: jhb, marcel- While at it, use DEVMETHOD_END. Discussed with: jhb- Also while at it, use __FBSDID.
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.
Use swap32() right.Submitted by: gcopperMFC after: 2 weeks
Remove extraneous semicolons, no functional changes.Submitted by: Marc Balmer <[email protected]>MFC after: 1 week
shutdown returns an int
bandaid crash as I have no time to research the issue and the driveris unusable in its present state; refer to the PR for detailsPR: kern/110662MFC after: 3 days
Overhaul driver/subsystem api's:o make all crypto drivers have a device_t; pseudo drivers like the s/w crypto driver synthesize oneo change the api between the crypto subsystem and drivers to use
Overhaul driver/subsystem api's:o make all crypto drivers have a device_t; pseudo drivers like the s/w crypto driver synthesize oneo change the api between the crypto subsystem and drivers to use kobj; cryptodev_if.m defines this apio use the fact that all crypto drivers now have a device_t to add support for specifying which of several potential devices to use when doing crypto operationso add new ioctls that allow user apps to select a specific crypto device to use (previous ioctls maintained for compatibility)o overhaul crypto subsystem code to eliminate lots of cruft and hide implementation details from driverso bring in numerous fixes from Michale Richardson/hifn; mostly for 795x partso add an optional mechanism for mmap'ing the hifn 795x public key h/w to user space for use by openssl (not enabled by default)o update crypto test tools to use new ioctl's and add cmd line options to specify a device to use for testsThese changes will also enable much future work on improving the corecrypto subsystem; including proper load balancing and interposing codebetween the core and drivers to dispatch small operations to the s/wdriver as appropriate.These changes were instigated by the work of Michael Richardson.Reviewed by: pjdApproved by: re
o break newbus api: add a new argument of type driver_filter_t to bus_setup_intr()o add an int return code to all fast handlerso retire INTR_FAST/IH_FASTFor more info: http://docs.freebsd.org
o break newbus api: add a new argument of type driver_filter_t to bus_setup_intr()o add an int return code to all fast handlerso retire INTR_FAST/IH_FASTFor more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-currentReviewed by: manyApproved by: re@
Use newly added functions to simplify the code.
Use defines from cryptodev.h.
12