Page MenuHomeFreeBSD

random(4): Match enabled sources mask to build options
ClosedPublic

Authored by cem on Sep 20 2018, 5:25 AM.

Details

Summary

r287023 and r334450 added build option mechanisms to permanently disable
spammy and/or low quality entropy sources.

Follow-up those changes by updating the 'enabled' sources mask to match.
When sources are compile-time disabled, represent them as disabled in the
source mask, and prevent users from modifying that, like pure sources.
(Modifying the mask bit would have no effect, but users might think it did
if it was not prevented.)

Mostly a cosmetic change.

Test Plan

Reboot and check the systems would be sufficient. Haven't done so yet. It
compiles.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

cem created this revision.Sep 20 2018, 5:25 AM
markm accepted this revision.Sep 20 2018, 7:31 AM
This revision is now accepted and ready to land.Sep 20 2018, 7:31 AM
cem added a comment.Oct 20 2018, 10:02 PM

Ping secteam

gordon accepted this revision as: secteam.Oct 20 2018, 10:47 PM
gordon added a subscriber: gordon.

Logic looks reasonable to me. I have only read through the logic, not tested it myself.

sys/dev/random/random_harvestq.c
67 ↗(On Diff #48249)

Not generally a fan of double negatives in logic (ETHER_OFF == 0). But no real objection otherwise.

cem marked an inline comment as done.Oct 20 2018, 10:56 PM
cem added inline comments.
sys/dev/random/random_harvestq.c
67 ↗(On Diff #48249)

I'll convert it to single-negative (mask + ~ operator in the use), if that sounds better. I'm also not a fan of double negatives in logic and don't recall why I did it this way.

cem planned changes to this revision.Oct 26 2018, 9:05 PM
cem marked an inline comment as done and an inline comment as not done.Oct 27 2018, 2:43 PM
cem added inline comments.
sys/dev/random/random_harvestq.c
67 ↗(On Diff #48249)

Hm, actually I want to leave it as is. Both uses of the flag need the current sense as-is and I don't want to restructure the code where it is used.

cem marked an inline comment as not done.Oct 27 2018, 3:09 PM
This revision was not accepted when it landed; it landed in state Changes Planned.
This revision was automatically updated to reflect the committed changes.