Page MenuHomeFreeBSD

random: allow disabling of entropy harvesting from keyboard & mice
ClosedPublic

Authored by obrien on Oct 28 2025, 5:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 19, 11:47 AM
Unknown Object (File)
Sun, Dec 7, 10:44 PM
Unknown Object (File)
Nov 18 2025, 12:03 PM
Unknown Object (File)
Nov 18 2025, 1:29 AM
Unknown Object (File)
Nov 17 2025, 3:42 PM
Unknown Object (File)
Nov 16 2025, 4:27 PM
Unknown Object (File)
Nov 14 2025, 12:47 PM
Unknown Object (File)
Nov 14 2025, 10:52 AM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

No need to explicitly include opt_global.h

Move to DEFAULTS and add tier-2

RANDOM_KEYBOARD and RANDOM_MOUSE can be masked away by sysctls. What is the need to remove them this way?

If your goal is to permit explicitly enabling or disabling random sources at compile time, I suggest going the KTR route, and having a RANDOM_COMPILE mask that defaults to everything enabled, allowing one to configure the random mask in the kernel config. This would centralize all this logic rather than having #ifdefs scattered around for each source.

RANDOM_KEYBOARD and RANDOM_MOUSE can be masked away by sysctls. What is the need to remove them this way?

If your goal is to permit explicitly enabling or disabling random sources at compile time, I suggest going the KTR route, and having a RANDOM_COMPILE mask that defaults to everything enabled, allowing one to configure the random mask in the kernel config. This would centralize all this logic rather than having #ifdefs scattered around for each source.

This is following what's already been established for RANDOM_ENABLE_UMA and RANDOM_ENABLE_ETHER. If that approach is wrong, then all of these enables should be re-architectured. Right now I'm trying to follow the RANDOM_ENABLE_ETHER/RANDOM_ENABLE_UMA precedent for Juniper Networks downstream needs.

jmg added a subscriber: jmg.

looks good.

Future improvement would be to move these enable options to a opt_random.h or something, and have that included by sys/random.h

This revision is now accepted and ready to land.Nov 10 2025, 5:54 PM
This revision now requires review to proceed.Nov 11 2025, 1:33 AM
This revision was not accepted when it landed; it landed in state Needs Review.Nov 11 2025, 4:18 AM
This revision was automatically updated to reflect the committed changes.