- Add DEV_RANDOM pseudo-option and use it to "include out" random(4) 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.
- Build modules for Yarrow and Fortuna.
- Use atomics for the live entropy rate-tracking.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 117 Build 117: arc lint + arc unit
Event Timeline
Thanks!
One thought: can we make DEV_RANDOM something like NO_DEV_RANDOM? That way it would be an opt-out feature, as most systems still need it.
Nope, sorry. The DEV_RANDOM pseudo-option comes for free from 'device random' in the kernel config file. There is no negative variant, but it is safe enough given that the kernel configs that need this device have it.
Please, do not add negative options.. Now that we have things like "nodevice random" that works in our config file, we don't need to add a new option like NO_DEV_RANDOM...
- Add DEV_RANDOM pseudo-option and use it to "include out" random(4)
- Update documentation for random(4) modules.
I removed 'manages' as an auto-reviewer - it gave a thoroughly broken scripted review.
UPDATING | ||
---|---|---|
36 | them, the kernel must have | |
41 | kldload(8) can then be used to load random_fortuna.ko or random_yarrow.ko. Please note that due to the indirect | |
share/man/man4/random.4 | ||
137–138 | Not yours, but missing a "to" | |
138–139 | Also not yours, but we are here now: | |
149 | "selected" is kind of ambiguous, could mean something other than "included in the config file". "used" is less fuzzy. Suggestion: When .Cd "options RANDOM_LOADABLE" is used, the .Pa /dev/random device is not created until an "algorithm module" is loaded. | |
153 | "such modules" might be difficult for translators. Simpler: Two of these modules are built by default, | |
158 | "The latter" requires the reader to look back and locate which was the last of an unspecified previous list. Simpler: The .Em random_yarrow module is deprecated and will be removed in | |
161 | This sentence is kind of back-to-front. It implies but does not outright state that Fortuna is used unless overridden with options RANDOM_YARROW, which is not recommended anyway (which should also be stated up front). The Fortuna algorithm is used by default. Use of the Yarrow algorithm is not encouraged, but when still present in the kernel, it can be selected with the .Cd "options RANDOM_YARROW" kernel option. | |
171 | s/need to/must/ | |
173 | s/need to/must/ |
- Add DEV_RANDOM pseudo-option and use it to "include out" random(4)
- Update documentation for random(4) modules.
What the hell is 'manpages' doing, blocking immediately on diff upload? Rogue script?
Minor comments.
sys/conf/options | ||
---|---|---|
714 | is this really needed in global? | |
sys/dev/random/random_harvestq.c | ||
61 | isn't RANDOM_DUMMY retired? Why include it here? | |
sys/dev/random/random_infra.c | ||
48 | RANDOM_DUMMY here too.. | |
68 | Maybe use the following so that the assignment of this variable is grouped closely, so it can easily be seen it gets defined in both cases, and also removed the #else that is far removed from the #if block. Maybe: #ifdef RANDOM_LOADABLE | |
sys/dev/random/randomdev.c | ||
70 | again RANDOM_DUMMY removed. | |
sys/dev/random/randomdev.h | ||
113–123 | Maybe opt_random.h should be included in this header file so we don't have to depend upon .c files having it? |
Thanks JMG.
sys/conf/options | ||
---|---|---|
714 | Yes. It is used when stubbing out calls that are all over the place. | |
sys/dev/random/random_harvestq.c | ||
61 | Oops. Removed! | |
sys/dev/random/random_infra.c | ||
68 | OK - neater, I agree. | |
sys/dev/random/randomdev.h | ||
113–123 | There is no precedent for that, that I could find. This is the sort of thing that attracts BDE bikesheds. |
sys/dev/random/randomdev.h | ||
---|---|---|
113–124 | there is precedence in sys/terminal.h, cam/cam.h, contrib/dev/acpica/include/platform/acfreebsd.h, and dev/usb/usb.h to name a few... Looks like 67 total cases: |
Thanks J-M!
sys/dev/random/randomdev.h | ||
---|---|---|
113–124 | Shows how well I checked that! OK. Moved to sys/random.h. |
sys/conf/options | ||
---|---|---|
714 | Turns out I was wrong. This has been fixed - see random.h. |
Add example module.
Move common _write functions to mase of module.
Remove unused functions.