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
This commit is contained in:
parent
2494b9e5de
commit
6c2aef9fc0
@ -2758,9 +2758,9 @@ rt2860.fw optional rt2860fw | ralfw \
|
||||
clean "rt2860.fw"
|
||||
dev/random/random_infra.c optional random
|
||||
dev/random/random_harvestq.c optional random
|
||||
dev/random/randomdev.c optional random
|
||||
dev/random/randomdev.c optional random !random_loadable
|
||||
dev/random/fortuna.c optional random !random_loadable
|
||||
dev/random/hash.c optional random
|
||||
dev/random/hash.c optional random !random_loadable
|
||||
dev/rc/rc.c optional rc
|
||||
dev/rccgpio/rccgpio.c optional rccgpio gpio
|
||||
dev/re/if_re.c optional re
|
||||
|
@ -368,8 +368,8 @@ dev/nvme/nvme_sysctl.c optional nvme
|
||||
dev/nvme/nvme_test.c optional nvme
|
||||
dev/nvme/nvme_util.c optional nvme
|
||||
dev/nvram/nvram.c optional nvram isa
|
||||
dev/random/ivy.c optional rdrand_rng
|
||||
dev/random/nehemiah.c optional padlock_rng
|
||||
dev/random/ivy.c optional rdrand_rng !random_loadable
|
||||
dev/random/nehemiah.c optional padlock_rng !random_loadable
|
||||
dev/qlxge/qls_dbg.c optional qlxge pci
|
||||
dev/qlxge/qls_dump.c optional qlxge pci
|
||||
dev/qlxge/qls_hw.c optional qlxge pci
|
||||
|
@ -87,7 +87,7 @@ arm/broadcom/bcm2835/bcm2835_ft5406.c optional evdev bcm2835_ft5406 soc_brcm_bc
|
||||
arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio soc_brcm_bcm2837 fdt
|
||||
arm/broadcom/bcm2835/bcm2835_intr.c optional soc_brcm_bcm2837 fdt
|
||||
arm/broadcom/bcm2835/bcm2835_mbox.c optional soc_brcm_bcm2837 fdt
|
||||
arm/broadcom/bcm2835/bcm2835_rng.c optional random soc_brcm_bcm2837 fdt
|
||||
arm/broadcom/bcm2835/bcm2835_rng.c optional random !random_loadable soc_brcm_bcm2837 fdt
|
||||
arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci soc_brcm_bcm2837 fdt
|
||||
arm/broadcom/bcm2835/bcm2835_sdhost.c optional sdhci soc_brcm_bcm2837 fdt
|
||||
arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi soc_brcm_bcm2837 fdt
|
||||
|
@ -301,8 +301,8 @@ dev/nvme/nvme_util.c optional nvme
|
||||
dev/nvram/nvram.c optional nvram isa
|
||||
dev/ofw/ofwpci.c optional fdt pci
|
||||
dev/pcf/pcf_isa.c optional pcf
|
||||
dev/random/ivy.c optional rdrand_rng
|
||||
dev/random/nehemiah.c optional padlock_rng
|
||||
dev/random/ivy.c optional rdrand_rng !random_loadable
|
||||
dev/random/nehemiah.c optional padlock_rng !random_loadable
|
||||
dev/sbni/if_sbni.c optional sbni
|
||||
dev/sbni/if_sbni_isa.c optional sbni isa
|
||||
dev/sbni/if_sbni_pci.c optional sbni pci
|
||||
|
@ -62,7 +62,7 @@ dev/ofw/ofw_standard.c optional aim powerpc
|
||||
dev/ofw/ofw_subr.c standard
|
||||
dev/powermac_nvram/powermac_nvram.c optional powermac_nvram powermac
|
||||
dev/quicc/quicc_bfe_fdt.c optional quicc mpc85xx
|
||||
dev/random/darn.c optional powerpc64 random
|
||||
dev/random/darn.c optional powerpc64 random !random_loadable
|
||||
dev/scc/scc_bfe_macio.c optional scc powermac
|
||||
dev/sdhci/fsl_sdhci.c optional mpc85xx sdhci
|
||||
dev/sec/sec.c optional sec mpc85xx
|
||||
|
@ -198,9 +198,12 @@ read_random(void *buf, u_int len)
|
||||
bool
|
||||
is_random_seeded(void)
|
||||
{
|
||||
bool result;
|
||||
|
||||
RANDOM_CONFIG_S_LOCK();
|
||||
random_reader_context.is_random_seeded();
|
||||
result = random_reader_context.is_random_seeded();
|
||||
RANDOM_CONFIG_S_UNLOCK();
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
||||
|
@ -88,6 +88,7 @@ DRIVER_MODULE(virtio_random, virtio_pci, vtrnd_driver, vtrnd_devclass,
|
||||
vtrnd_modevent, 0);
|
||||
MODULE_VERSION(virtio_random, 1);
|
||||
MODULE_DEPEND(virtio_random, virtio, 1, 1, 1);
|
||||
MODULE_DEPEND(virtio_random, random_device, 1, 1, 1);
|
||||
|
||||
static int
|
||||
vtrnd_modevent(module_t mod, int type, void *unused)
|
||||
|
Loading…
x
Reference in New Issue
Block a user