From owner-svn-src-all@freebsd.org Fri Nov 22 20:24:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FD6C1C0D0F; Fri, 22 Nov 2019 20:24:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47KSZS0pbfz4D4D; Fri, 22 Nov 2019 20:24:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9F37F7B; Fri, 22 Nov 2019 20:24:15 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAMKOFbO021390; Fri, 22 Nov 2019 20:24:15 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAMKOFbo021386; Fri, 22 Nov 2019 20:24:15 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201911222024.xAMKOFbo021386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 22 Nov 2019 20:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355022 - head/sys/dev/random X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/random X-SVN-Commit-Revision: 355022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Nov 2019 20:24:16 -0000 Author: cem Date: Fri Nov 22 20:24:15 2019 New Revision: 355022 URL: https://svnweb.freebsd.org/changeset/base/355022 Log: 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 Modified: head/sys/dev/random/random_harvestq.c head/sys/dev/random/random_infra.c head/sys/dev/random/randomdev.h Modified: head/sys/dev/random/random_harvestq.c ============================================================================== --- head/sys/dev/random/random_harvestq.c Fri Nov 22 20:23:22 2019 (r355021) +++ head/sys/dev/random/random_harvestq.c Fri Nov 22 20:24:15 2019 (r355022) @@ -98,6 +98,14 @@ volatile int random_kthread_control; */ __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, "Entropy Device Parameters"); Modified: head/sys/dev/random/random_infra.c ============================================================================== --- head/sys/dev/random/random_infra.c Fri Nov 22 20:23:22 2019 (r355021) +++ head/sys/dev/random/random_infra.c Fri Nov 22 20:24:15 2019 (r355022) @@ -101,8 +101,6 @@ SYSCTL_BOOL(_kern_random_initial_seeding, OID_AUTO, 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) struct random_algorithm *p_random_alg_context = NULL; #else /* !defined(RANDOM_LOADABLE) */ Modified: head/sys/dev/random/randomdev.h ============================================================================== --- head/sys/dev/random/randomdev.h Fri Nov 22 20:23:22 2019 (r355021) +++ head/sys/dev/random/randomdev.h Fri Nov 22 20:24:15 2019 (r355022) @@ -102,14 +102,6 @@ struct random_source { 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_deregister(struct random_source *);