HomeFreeBSD

random: Fix synchronization of hc_source_mask

Description

random: Fix synchronization of hc_source_mask

This variable provides a mask of all registered entropy sources and is
updated when drivers attach and detach (or by sysctl). However, nothing
was synchronizing accesses to it. Use the harvest lock to provide
mutual exclusion for updates, and use atomic_load_int() to mark unlocked
reads.

Reviewed by: cem
MFC after: 2 weeks
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D52230

Details

Provenance
markjAuthored on Sep 8 2025, 2:42 PM
Reviewer
cem
Differential Revision
D52230: random: Fix synchronization of hc_source_mask
Parents
rG8635f8697763: random: Make the entropy source registration interface more uniform
Branches
Unknown
Tags
Unknown