| #
3a58c266
|
| 11-May-2025 |
Ed Maste <emaste@FreeBSD.org> |
random(9): bump removal to FreeBSD 16.0
It has not yet been removed, and still has some in-tree consumers.
PR: 277655 Sponsored by: The FreeBSD Foundation
|
| #
f50322c1
|
| 18-Mar-2024 |
Ed Maste <emaste@FreeBSD.org> |
random(9): bump removal to FreeBSD 15.0
It has not yet been removed, and still has some in-tree consumers.
PR: 277655 Sponsored by: The FreeBSD Foundation
|
| #
fa9896e0
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: two-line nroff pattern
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
|
| #
dbbf3e3f
|
| 24-Mar-2021 |
Lawrence Stewart <lstewart@FreeBSD.org> |
random(9): Restore historical [0,2^31-1] output range and related man documention.
Commit SVN r364219 / Git 8a0edc914ffd changed random(9) to be a shim around prng32(9) and inadvertently caused rand
random(9): Restore historical [0,2^31-1] output range and related man documention.
Commit SVN r364219 / Git 8a0edc914ffd changed random(9) to be a shim around prng32(9) and inadvertently caused random(9) to begin returning numbers in the range [0,2^32-1] instead of [0,2^31-1], where the latter has been the documented range for decades.
The increased output range has been identified as the source of numerous bugs in code written against the historical output range e.g. ipfw "prob" rules and stats(3) are known to be affected, and a non-exhaustive audit of the tree identified other random(9) consumers which are also likely affected.
As random(9) is deprecated and slated for eventual removal in 14.0, consumers should gradually be audited and migrated to prng(9).
Submitted by: Loic Prylli <lprylli@netflix.com> Obtained from: Netflix Reviewed by: cem, delphij, imp MFC after: 1 day MFC to: stable/13, releng/13.0 Differential Revision: https://reviews.freebsd.org/D29385
show more ...
|
| #
f3bae413
|
| 26-Dec-2019 |
Conrad Meyer <cem@FreeBSD.org> |
random(9): Deprecate random(9), remove meaningless srandom(9)
srandom(9) is meaningless on SMP systems or any system with, say, interrupts. One could never rely on random(9) to produce a reproducib
random(9): Deprecate random(9), remove meaningless srandom(9)
srandom(9) is meaningless on SMP systems or any system with, say, interrupts. One could never rely on random(9) to produce a reproducible sequence of outputs on the basis of a specific srandom() seed because the global state was shared by all kernel contexts. As such, removing it is literally indistinguishable to random(9) consumers (as compared with retaining it).
Mark random(9) as deprecated and slated for quick removal. This is not to say we intend to remove all fast, non-cryptographic PRNG(s) in the kernel. It/they just won't be random(9), as it exists today, in either name or implementation.
Before random(9) is removed, a replacement will be provided and in-tree consumers will be converted.
Note that despite the name, the random(9) interface does not bear any resemblance to random(3). Instead, it is the same crummy 1988 Park-Miller LCG used in libc rand(3).
show more ...
|
| #
7648bc9f
|
| 13-May-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @347527
Sponsored by: The FreeBSD Foundation
|
| #
6b97c2e3
|
| 19-Apr-2019 |
Conrad Meyer <cem@FreeBSD.org> |
Revert r346410 and r346411
libkern in .PATH has too many filename conflicts with libc and my -DNO_CLEAN tinderbox didn't catch that ahead of time. Mea culpa.
|
| #
7deb4b19
|
| 19-Apr-2019 |
Conrad Meyer <cem@FreeBSD.org> |
libkern: Bring in arc4random_uniform(9) from libc
It is a useful arc4random wrapper in the kernel for much the same reasons as in userspace. Move the source to libkern (because kernel build is rest
libkern: Bring in arc4random_uniform(9) from libc
It is a useful arc4random wrapper in the kernel for much the same reasons as in userspace. Move the source to libkern (because kernel build is restricted to sys/, but userspace can include any file it likes) and build kernel and libc versions from the same source file.
Copy the documentation from arc4random_uniform(3) to the section 9 page.
While here, add missing arc4random_buf(9) symlink.
Sponsored by: Dell EMC Isilon
show more ...
|
| #
f3d2512d
|
| 16-Apr-2019 |
Conrad Meyer <cem@FreeBSD.org> |
random(4): Add is_random_seeded(9) KPI
The imagined use is for early boot consumers of random to be able to make decisions based on whether random is available yet or not. One such consumer seems t
random(4): Add is_random_seeded(9) KPI
The imagined use is for early boot consumers of random to be able to make decisions based on whether random is available yet or not. One such consumer seems to be __stack_chk_init(), which runs immediately after random is initialized. A follow-up patch will attempt to address that.
Reported by: many Reviewed by: delphij (except man page) Approved by: secteam(delphij) Differential Revision: https://reviews.freebsd.org/D19926
show more ...
|
| #
13774e82
|
| 15-Apr-2019 |
Conrad Meyer <cem@FreeBSD.org> |
random(4): Block read_random(9) on initial seeding
read_random() is/was used, mostly without error checking, in a lot of very sensitive places in the kernel -- including seeding the widely used arc4
random(4): Block read_random(9) on initial seeding
read_random() is/was used, mostly without error checking, in a lot of very sensitive places in the kernel -- including seeding the widely used arc4random(9).
Most uses, especially arc4random(9), should block until the device is seeded rather than proceeding with a bogus or empty seed. I did not spy any obvious kernel consumers where blocking would be inappropriate (in the sense that lack of entropy would be ok -- I did not investigate locking angle thoroughly). In many instances, arc4random_buf(9) or that family of APIs would be more appropriate anyway; that work was done in r345865.
A minor cleanup was made to the implementation of the READ_RANDOM function: instead of using a variable-length array on the stack to temporarily store all full random blocks sufficient to satisfy the requested 'len', only store a single block on the stack. This has some benefit in terms of reducing stack usage, reducing memcpy overhead and reducing devrandom output leakage via the stack. Additionally, the stack block is now safely zeroed if it was used.
One caveat of this change is that the kern.arandom sysctl no longer returns zero bytes immediately if the random device is not seeded. This means that FreeBSD-specific userspace applications which attempted to handle an unseeded random device may be broken by this change. If such behavior is needed, it can be replaced by the more portable getrandom(2) GRND_NONBLOCK option.
On any typical FreeBSD system, entropy is persisted on read/write media and used to seed the random device very early in boot, and blocking is never a problem.
This change primarily impacts the behavior of /dev/random on embedded systems with read-only media that do not configure "nodevice random". We toggle the default from 'charge on blindly with no entropy' to 'block indefinitely.' This default is safer, but may cause frustration. Embedded system designers using FreeBSD have several options. The most obvious is to plan to have a small writable NVRAM or NAND to persist entropy, like larger systems. Early entropy can be fed from any loader, or by writing directly to /dev/random during boot. Some embedded SoCs now provide a fast hardware entropy source; this would also work for quickly seeding Fortuna. A 3rd option would be creating an embedded-specific, more simplistic random module, like that designed by DJB in [1] (this design still requires a small rewritable media for forward secrecy). Finally, the least preferred option might be "nodevice random", although I plan to remove this in a subsequent revision.
To help developers emulate the behavior of these embedded systems on ordinary workstations, the tunable kern.random.block_seeded_status was added. When set to 1, it blocks the random device.
I attempted to document this change in random.4 and random.9 and ran into a bunch of out-of-date or irrelevant or inaccurate content and ended up rototilling those documents more than I intended to. Sorry. I think they're in a better state now.
PR: 230875 Reviewed by: delphij, markm (earlier version) Approved by: secteam(delphij), devrandom(markm) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D19744
show more ...
|
| #
3a58c266
|
| 11-May-2025 |
Ed Maste <emaste@FreeBSD.org> |
random(9): bump removal to FreeBSD 16.0
It has not yet been removed, and still has some in-tree consumers.
PR: 277655 Sponsored by: The FreeBSD Foundation
|
| #
f50322c1
|
| 18-Mar-2024 |
Ed Maste <emaste@FreeBSD.org> |
random(9): bump removal to FreeBSD 15.0
It has not yet been removed, and still has some in-tree consumers.
PR: 277655 Sponsored by: The FreeBSD Foundation
|
| #
fa9896e0
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: two-line nroff pattern
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
|
| #
dbbf3e3f
|
| 24-Mar-2021 |
Lawrence Stewart <lstewart@FreeBSD.org> |
random(9): Restore historical [0,2^31-1] output range and related man documention.
Commit SVN r364219 / Git 8a0edc914ffd changed random(9) to be a shim around prng32(9) and inadvertently caused rand
random(9): Restore historical [0,2^31-1] output range and related man documention.
Commit SVN r364219 / Git 8a0edc914ffd changed random(9) to be a shim around prng32(9) and inadvertently caused random(9) to begin returning numbers in the range [0,2^32-1] instead of [0,2^31-1], where the latter has been the documented range for decades.
The increased output range has been identified as the source of numerous bugs in code written against the historical output range e.g. ipfw "prob" rules and stats(3) are known to be affected, and a non-exhaustive audit of the tree identified other random(9) consumers which are also likely affected.
As random(9) is deprecated and slated for eventual removal in 14.0, consumers should gradually be audited and migrated to prng(9).
Submitted by: Loic Prylli <lprylli@netflix.com> Obtained from: Netflix Reviewed by: cem, delphij, imp MFC after: 1 day MFC to: stable/13, releng/13.0 Differential Revision: https://reviews.freebsd.org/D29385
show more ...
|
| #
f3bae413
|
| 26-Dec-2019 |
Conrad Meyer <cem@FreeBSD.org> |
random(9): Deprecate random(9), remove meaningless srandom(9)
srandom(9) is meaningless on SMP systems or any system with, say, interrupts. One could never rely on random(9) to produce a reproducib
random(9): Deprecate random(9), remove meaningless srandom(9)
srandom(9) is meaningless on SMP systems or any system with, say, interrupts. One could never rely on random(9) to produce a reproducible sequence of outputs on the basis of a specific srandom() seed because the global state was shared by all kernel contexts. As such, removing it is literally indistinguishable to random(9) consumers (as compared with retaining it).
Mark random(9) as deprecated and slated for quick removal. This is not to say we intend to remove all fast, non-cryptographic PRNG(s) in the kernel. It/they just won't be random(9), as it exists today, in either name or implementation.
Before random(9) is removed, a replacement will be provided and in-tree consumers will be converted.
Note that despite the name, the random(9) interface does not bear any resemblance to random(3). Instead, it is the same crummy 1988 Park-Miller LCG used in libc rand(3).
show more ...
|
| #
7648bc9f
|
| 13-May-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @347527
Sponsored by: The FreeBSD Foundation
|
| #
6b97c2e3
|
| 19-Apr-2019 |
Conrad Meyer <cem@FreeBSD.org> |
Revert r346410 and r346411
libkern in .PATH has too many filename conflicts with libc and my -DNO_CLEAN tinderbox didn't catch that ahead of time. Mea culpa.
|
| #
7deb4b19
|
| 19-Apr-2019 |
Conrad Meyer <cem@FreeBSD.org> |
libkern: Bring in arc4random_uniform(9) from libc
It is a useful arc4random wrapper in the kernel for much the same reasons as in userspace. Move the source to libkern (because kernel build is rest
libkern: Bring in arc4random_uniform(9) from libc
It is a useful arc4random wrapper in the kernel for much the same reasons as in userspace. Move the source to libkern (because kernel build is restricted to sys/, but userspace can include any file it likes) and build kernel and libc versions from the same source file.
Copy the documentation from arc4random_uniform(3) to the section 9 page.
While here, add missing arc4random_buf(9) symlink.
Sponsored by: Dell EMC Isilon
show more ...
|
| #
f3d2512d
|
| 16-Apr-2019 |
Conrad Meyer <cem@FreeBSD.org> |
random(4): Add is_random_seeded(9) KPI
The imagined use is for early boot consumers of random to be able to make decisions based on whether random is available yet or not. One such consumer seems t
random(4): Add is_random_seeded(9) KPI
The imagined use is for early boot consumers of random to be able to make decisions based on whether random is available yet or not. One such consumer seems to be __stack_chk_init(), which runs immediately after random is initialized. A follow-up patch will attempt to address that.
Reported by: many Reviewed by: delphij (except man page) Approved by: secteam(delphij) Differential Revision: https://reviews.freebsd.org/D19926
show more ...
|
| #
13774e82
|
| 15-Apr-2019 |
Conrad Meyer <cem@FreeBSD.org> |
random(4): Block read_random(9) on initial seeding
read_random() is/was used, mostly without error checking, in a lot of very sensitive places in the kernel -- including seeding the widely used arc4
random(4): Block read_random(9) on initial seeding
read_random() is/was used, mostly without error checking, in a lot of very sensitive places in the kernel -- including seeding the widely used arc4random(9).
Most uses, especially arc4random(9), should block until the device is seeded rather than proceeding with a bogus or empty seed. I did not spy any obvious kernel consumers where blocking would be inappropriate (in the sense that lack of entropy would be ok -- I did not investigate locking angle thoroughly). In many instances, arc4random_buf(9) or that family of APIs would be more appropriate anyway; that work was done in r345865.
A minor cleanup was made to the implementation of the READ_RANDOM function: instead of using a variable-length array on the stack to temporarily store all full random blocks sufficient to satisfy the requested 'len', only store a single block on the stack. This has some benefit in terms of reducing stack usage, reducing memcpy overhead and reducing devrandom output leakage via the stack. Additionally, the stack block is now safely zeroed if it was used.
One caveat of this change is that the kern.arandom sysctl no longer returns zero bytes immediately if the random device is not seeded. This means that FreeBSD-specific userspace applications which attempted to handle an unseeded random device may be broken by this change. If such behavior is needed, it can be replaced by the more portable getrandom(2) GRND_NONBLOCK option.
On any typical FreeBSD system, entropy is persisted on read/write media and used to seed the random device very early in boot, and blocking is never a problem.
This change primarily impacts the behavior of /dev/random on embedded systems with read-only media that do not configure "nodevice random". We toggle the default from 'charge on blindly with no entropy' to 'block indefinitely.' This default is safer, but may cause frustration. Embedded system designers using FreeBSD have several options. The most obvious is to plan to have a small writable NVRAM or NAND to persist entropy, like larger systems. Early entropy can be fed from any loader, or by writing directly to /dev/random during boot. Some embedded SoCs now provide a fast hardware entropy source; this would also work for quickly seeding Fortuna. A 3rd option would be creating an embedded-specific, more simplistic random module, like that designed by DJB in [1] (this design still requires a small rewritable media for forward secrecy). Finally, the least preferred option might be "nodevice random", although I plan to remove this in a subsequent revision.
To help developers emulate the behavior of these embedded systems on ordinary workstations, the tunable kern.random.block_seeded_status was added. When set to 1, it blocks the random device.
I attempted to document this change in random.4 and random.9 and ran into a bunch of out-of-date or irrelevant or inaccurate content and ended up rototilling those documents more than I intended to. Sorry. I think they're in a better state now.
PR: 230875 Reviewed by: delphij, markm (earlier version) Approved by: secteam(delphij), devrandom(markm) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D19744
show more ...
|
| #
b5ff185e
|
| 12-Sep-2015 |
Baptiste Daroussin <bapt@FreeBSD.org> |
Merge from head
|
| #
ab875b71
|
| 13-Aug-2015 |
Navdeep Parhar <np@FreeBSD.org> |
Catch up with head, primarily for the 1.14.4.0 firmware.
|
| #
8d0f1085
|
| 22-Jul-2015 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r285341 through r285792.
|
| #
50f960e6
|
| 16-Jul-2015 |
Ed Schouten <ed@FreeBSD.org> |
Fix a small typo: "the the".
Spotted by: wblock
|
| #
707d98fe
|
| 14-Jul-2015 |
Ed Schouten <ed@FreeBSD.org> |
Implement the CloudABI random_get() system call.
The random_get() system call works similar to getentropy()/getrandom() on OpenBSD/Linux. It fills a buffer with random data.
This change introduces
Implement the CloudABI random_get() system call.
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
show more ...
|