Page MenuHomeFreeBSD

random(4): Abstract loader entropy injection
ClosedPublic

Authored by cem on Nov 21 2019, 6:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 22, 6:55 PM
Unknown Object (File)
Sun, Dec 22, 6:52 PM
Unknown Object (File)
Sat, Dec 21, 4:29 PM
Unknown Object (File)
Oct 19 2024, 10:22 AM
Unknown Object (File)
Sep 27 2024, 12:57 AM
Unknown Object (File)
Sep 26 2024, 6:38 AM
Unknown Object (File)
Sep 23 2024, 7:42 AM
Unknown Object (File)
Sep 22 2024, 8:15 PM
Subscribers

Details

Summary

Break random_harvestq_prime up into some logical subroutines.

No functional change.

The goal is that it becomes easier to add other early entropy sources.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

delphij added a subscriber: delphij.

I think the proposed change actually does change the code behavior slightly.

What the old code does is basically "if we don't see an object of type 'boot_entropy_cache', try looking up the one with type '/boot/entropy' instead".

The new code validates both whether the object of 'boot_entroy_cache' is preloaded (existing behavior), and if the loaded object was sane (newly added behavior; previously we would not check the sanity before proceeding further, and it seemed to be reasonable because the expectation was that the type is either boot_entropy_cache, or '/boot/entropy' and the loaded file would be the same one).

The compatibility code wrapped in the NO_BACKWARD_COMPATIBILITY block was delivered in 12.0-RELEASE, but we didn't issued a warning that "please please update your /boot/defaults/loader.conf now" in the fallback case (we should have done that ~3 years ago, but now it's probably less relevant).

I would suggest that we simply delete that compatibility shim instead: it wasn't the intention to support both types permanently, and the code is already short enough to fit in one page.

This revision now requires changes to proceed.Nov 22 2019, 12:26 AM

Drop NO_BACKWARD_COMPATIBILITY shim.

This revision is now accepted and ready to land.Nov 22 2019, 6:29 AM

(Note that the refactor is not really needed, but I don't have strong opinion here).

This revision was automatically updated to reflect the committed changes.