freebsd-dev/sys/dev/random
Conrad Meyer 5ca5dfe938 random(4): Fix RANDOM_LOADABLE build
I introduced an obvious compiler error in r346282, so this change fixes
that.

Unfortunately, RANDOM_LOADABLE isn't covered by our existing tinderbox, and
it seems like there were existing latent linking problems.  I believe these
were introduced on accident in r338324 during reduction of the boolean
expression(s) adjacent to randomdev.c and hash.c.  It seems the
RANDOM_LOADABLE build breakage has gone unnoticed for nine months.

This change correctly annotates randomdev.c and hash.c with !random_loadable
to match the pre-r338324 logic; and additionally updates the HWRNG drivers
in MD 'files.*', which depend on random_device symbols, with
!random_loadable (it is invalid for the kernel to depend on symbols from a
module).

(The expression for both randomdev.c and hash.c was the same, prior to
r338324: "optional random random_yarrow | random !random_yarrow
!random_loadable".  I.e., "random && (yarrow || !loadable)."  When Yarrow
was removed ("yarrow := False"), the expression was incorrectly reduced to
"optional random" when it should have retained "random && !loadable".)

Additionally, I discovered that virtio_random was missing a MODULE_DEPEND on
random_device, which breaks kld load/link of the driver on RANDOM_LOADABLE
kernels.  Address that issue as well.

PR:		238223
Reported by:	Eir Nym <eirnym AT gmail.com>
Reviewed by:	delphij, markm
Approved by:	secteam(delphij)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D20466
2019-06-01 01:22:21 +00:00
..
build.sh Remove the Yarrow PRNG algorithm option in accordance with due notice 2018-08-26 12:51:46 +00:00
darn.c random: Add PowerPC 'darn' instruction entropy source 2018-08-17 03:49:07 +00:00
fortuna.c random(4): deduplicate explicit_bzero() in harvest 2019-05-23 21:02:27 +00:00
fortuna.h
hash.c Fortuna: Add Chacha20 as an alternative stream cipher 2019-03-08 01:17:20 +00:00
hash.h Fortuna: Add Chacha20 as an alternative stream cipher 2019-03-08 01:17:20 +00:00
ivy.c Remove resolver_qual from DEFINE_IFUNC/DEFINE_UIFUNC macros. 2019-05-16 22:20:54 +00:00
nehemiah.c Remove unused error return from API that cannot fail 2018-02-23 20:15:19 +00:00
other_algorithm.c Remove the Yarrow PRNG algorithm option in accordance with due notice 2018-08-26 12:51:46 +00:00
other_algorithm.h Remove the Yarrow PRNG algorithm option in accordance with due notice 2018-08-26 12:51:46 +00:00
random_harvestq.c random(4): deduplicate explicit_bzero() in harvest 2019-05-23 21:02:27 +00:00
random_harvestq.h Remove the Yarrow PRNG algorithm option in accordance with due notice 2018-08-26 12:51:46 +00:00
random_infra.c random(4): Fix RANDOM_LOADABLE build 2019-06-01 01:22:21 +00:00
randomdev.c random(4): deduplicate explicit_bzero() in harvest 2019-05-23 21:02:27 +00:00
randomdev.h random(4): Restore availability tradeoff prior to r346250 2019-04-18 20:48:54 +00:00
uint128.h Fortuna: Add Chacha20 as an alternative stream cipher 2019-03-08 01:17:20 +00:00
unit_test.c Remove the Yarrow PRNG algorithm option in accordance with due notice 2018-08-26 12:51:46 +00:00
unit_test.h Remove the Yarrow PRNG algorithm option in accordance with due notice 2018-08-26 12:51:46 +00:00