random(4): De-export random_sources list

The internal datastructures do not need to be visible outside of
random_harvestq, and this helps ensure they are not misused.

No functional change.

Approved by:	csprng(delphij, markm)
Differential Revision:	https://reviews.freebsd.org/D22485
This commit is contained in:
Conrad Meyer 2019-11-22 20:24:15 +00:00
parent 02d4535d2d
commit b6db1cc710
3 changed files with 8 additions and 10 deletions

View File

@ -98,6 +98,14 @@ volatile int random_kthread_control;
*/ */
__read_frequently u_int hc_source_mask; __read_frequently u_int hc_source_mask;
struct random_sources {
LIST_ENTRY(random_sources) rrs_entries;
struct random_source *rrs_source;
};
static LIST_HEAD(sources_head, random_sources) source_list =
LIST_HEAD_INITIALIZER(source_list);
SYSCTL_NODE(_kern_random, OID_AUTO, harvest, CTLFLAG_RW, 0, SYSCTL_NODE(_kern_random, OID_AUTO, harvest, CTLFLAG_RW, 0,
"Entropy Device Parameters"); "Entropy Device Parameters");

View File

@ -101,8 +101,6 @@ SYSCTL_BOOL(_kern_random_initial_seeding, OID_AUTO,
MALLOC_DEFINE(M_ENTROPY, "entropy", "Entropy harvesting buffers and data structures"); MALLOC_DEFINE(M_ENTROPY, "entropy", "Entropy harvesting buffers and data structures");
struct sources_head source_list = LIST_HEAD_INITIALIZER(source_list);
#if defined(RANDOM_LOADABLE) #if defined(RANDOM_LOADABLE)
struct random_algorithm *p_random_alg_context = NULL; struct random_algorithm *p_random_alg_context = NULL;
#else /* !defined(RANDOM_LOADABLE) */ #else /* !defined(RANDOM_LOADABLE) */

View File

@ -102,14 +102,6 @@ struct random_source {
random_source_read_t *rs_read; random_source_read_t *rs_read;
}; };
struct random_sources {
LIST_ENTRY(random_sources) rrs_entries;
struct random_source *rrs_source;
};
LIST_HEAD(sources_head, random_sources);
extern struct sources_head source_list;
void random_source_register(struct random_source *); void random_source_register(struct random_source *);
void random_source_deregister(struct random_source *); void random_source_deregister(struct random_source *);