WSL2-Linux-Kernel/drivers/char/hw_random
Jason Wang 228432551b virtio-rng: make device ready before making request
Current virtio-rng does a entropy request before DRIVER_OK, this
violates the spec:

virtio spec requires that all drivers set DRIVER_OK
before using devices.

Further, kernel will ignore the interrupt after commit
8b4ec69d7e ("virtio: harden vring IRQ").

Fixing this by making device ready before the request.

Cc: stable@vger.kernel.org
Fixes: 8b4ec69d7e ("virtio: harden vring IRQ")
Fixes: f7f510ec19 ("virtio: An entropy device, as suggested by hpa.")
Reported-and-tested-by: syzbot+5b59d6d459306a556f54@syzkaller.appspotmail.com
Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20220608061422.38437-1-jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
2022-06-08 08:56:03 -04:00
..
Kconfig hwrng: cn10k - Enable compile testing 2022-05-06 18:16:55 +08:00
Makefile hwrng: mpfs - add polarfire soc hwrng support 2022-04-15 16:34:28 +08:00
amd-rng.c hwrng: rename 'mod_init' & 'mod_exit' functions to be module-specific 2021-07-16 15:49:36 +08:00
arm_smccc_trng.c hwrng: Add Arm SMCCC TRNG based driver 2021-08-06 19:45:26 +08:00
atmel-rng.c hwrng: atmel - remove extra line 2022-03-03 10:46:19 +12:00
ba431-rng.c hwrng: ba431 - use devm_platform_ioremap_resource() to simplify 2021-03-19 21:59:46 +11:00
bcm2835-rng.c hwrng: bcm2835 - add reset support 2021-03-13 00:04:06 +11:00
cavium-rng-vf.c hwrng: cavium - fix NULL but dereferenced coccicheck error 2022-03-03 10:49:22 +12:00
cavium-rng.c hwrng: cavium - Check health status while reading random data 2021-11-20 15:02:07 +11:00
cctrng.c hwrng: cctrng - delete redundant printing of return value 2021-03-19 21:59:47 +11:00
cctrng.h hwrng: cctrng - introduce Arm CryptoCell driver 2020-04-16 16:49:20 +10:00
cn10k-rng.c hwrng: cn10k - Make check_rng_health() return an error code 2022-04-21 17:53:55 +08:00
core.c Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2022-03-21 16:02:36 -07:00
exynos-trng.c hwrng: exynos - Use pm_runtime_resume_and_get() to replace open coding 2021-06-03 20:24:04 +08:00
geode-rng.c hwrng: rename 'mod_init' & 'mod_exit' functions to be module-specific 2021-07-16 15:49:36 +08:00
hisi-rng.c hwrng: hisi - Fix W=1 unused variable warning 2020-07-09 18:25:12 +10:00
imx-rngc.c hwrng: imx-rngc - irq already prints an error 2020-11-06 14:31:15 +11:00
ingenic-rng.c crypto: ingenic - Drop kfree for memory allocated with devm_kzalloc 2020-08-21 14:43:51 +10:00
ingenic-trng.c hwrng: ingenic - Fix a resource leak in an error handling path 2021-01-03 08:41:37 +11:00
intel-rng.c hwrng: rename 'mod_init' & 'mod_exit' functions to be module-specific 2021-07-16 15:49:36 +08:00
iproc-rng200.c hwrng: iproc-rng200 - Move enable/disable in separate function 2021-01-03 08:41:37 +11:00
ixp4xx-rng.c hwrng: ixp4xx - Make use of the helper function devm_platform_ioremap_resource() 2021-09-17 11:06:14 +08:00
ks-sa-rng.c hwrng: ks-sa - Use pm_runtime_resume_and_get() to replace open coding 2021-06-03 20:24:04 +08:00
meson-rng.c hwrng: meson - Improve error handling for core clock 2021-10-01 14:41:23 +08:00
mpfs-rng.c hwrng: mpfs - add polarfire soc hwrng support 2022-04-15 16:34:28 +08:00
mtk-rng.c hwrng: mtk - Force runtime pm ops for sleep ops 2021-10-08 20:02:47 +08:00
mxc-rnga.c hwrng: mxc-rnga - use semicolons rather than commas to separate statements 2020-10-02 18:02:15 +10:00
n2-asm.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
n2-drv.c hwrng: n2-drv - fix typo 2019-08-08 12:07:49 +10:00
n2rng.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nomadik-rng.c hwrng: nomadik - Change clk_disable to clk_disable_unprepare 2022-03-14 14:45:44 +12:00
npcm-rng.c hwrng: npcm - modify readl to readb 2020-10-02 18:02:13 +10:00
octeon-rng.c hwrng: octeon - Fix sparse warnings 2020-07-09 18:25:14 +10:00
omap-rng.c hwrng: omap - Use pm_runtime_resume_and_get() to replace open coding 2021-06-03 20:24:04 +08:00
omap3-rom-rng.c hwrng: omap3-rom - fix using wrong clk_disable() in omap_rom_rng_runtime_resume() 2022-05-20 13:54:45 +08:00
optee-rng.c hwrng: optee - remove redundant initialization to variable rng_size 2022-04-29 13:44:58 +08:00
pasemi-rng.c hwrng: pasemi - use devm_platform_ioremap_resource() to simplify code 2019-10-26 02:09:56 +11:00
pic32-rng.c hwrng: pic32 - Use device-managed registration API 2021-03-13 00:04:00 +11:00
powernv-rng.c hwrng: drivers - Use device-managed registration API 2019-08-02 14:44:33 +10:00
pseries-rng.c char: hw_random: pseries-rng: Demote non-conformant kernel-doc header 2021-05-21 10:09:30 +02:00
s390-trng.c hwrng: s390 - replace snprintf in show functions with sysfs_emit 2021-10-22 20:24:12 +08:00
st-rng.c hwrng: st - Fix W=1 unused variable warning 2020-07-09 18:25:12 +10:00
stm32-rng.c hwrng: stm32 - use semicolons rather than commas to separate statements 2020-10-02 18:02:14 +10:00
timeriomem-rng.c hwrng: timeriomem - Use device-managed registration API 2021-02-10 17:56:01 +11:00
via-rng.c hwrng: rename 'mod_init' & 'mod_exit' functions to be module-specific 2021-07-16 15:49:36 +08:00
virtio-rng.c virtio-rng: make device ready before making request 2022-06-08 08:56:03 -04:00
xgene-rng.c hwrng: xgene - Delete an error message in xgene_rng_probe() 2020-04-16 16:49:22 +10:00
xiphera-trng.c hwrng: xiphera-trng - use devm_platform_ioremap_resource() to simplify 2021-03-07 15:13:14 +11:00