WSL2-Linux-Kernel/drivers/char/hw_random
Herbert Xu 26cc6d7006 hwrng: core - Fix page fault dead lock on mmap-ed hwrng
commit 78aafb3884f6bc6636efcc1760c891c8500b9922 upstream.

There is a dead-lock in the hwrng device read path.  This triggers
when the user reads from /dev/hwrng into memory also mmap-ed from
/dev/hwrng.  The resulting page fault triggers a recursive read
which then dead-locks.

Fix this by using a stack buffer when calling copy_to_user.

Reported-by: Edward Adam Davis <eadavis@qq.com>
Reported-by: syzbot+c52ab18308964d248092@syzkaller.appspotmail.com
Fixes: 9996508b33 ("hwrng: core - Replace u32 in driver API with byte array")
Cc: <stable@vger.kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-02-23 08:54:24 +01:00
..
Kconfig hwrng: cavium - HW_RANDOM_CAVIUM should depend on ARCH_THUNDER 2022-04-08 14:23:05 +02:00
Makefile hwrng: Add Arm SMCCC TRNG based driver 2021-08-06 19:45:26 +08:00
amd-rng.c hwrng: amd - Fix PCI device refcount leak 2022-12-31 13:14:26 +01:00
arm_smccc_trng.c hwrng: arm-smccc-trng - fix NO_ENTROPY handling 2022-10-26 12:35:24 +02:00
atmel-rng.c hwrng: atmel - disable trng on failure path 2022-04-08 14:23:08 +02:00
ba431-rng.c
bcm2835-rng.c
cavium-rng-vf.c hwrng: cavium - Check health status while reading random data 2022-04-08 14:23:05 +02:00
cavium-rng.c hwrng: cavium - Check health status while reading random data 2022-04-08 14:23:05 +02:00
cctrng.c
cctrng.h
core.c hwrng: core - Fix page fault dead lock on mmap-ed hwrng 2024-02-23 08:54:24 +01:00
exynos-trng.c
geode-rng.c hwrng: geode - fix accessing registers 2023-11-20 11:08:22 +01:00
hisi-rng.c
imx-rngc.c hwrng: imx-rngc - fix the timeout for init and self check 2023-07-23 13:47:49 +02:00
ingenic-rng.c
ingenic-trng.c
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 - Implement suspend and resume calls 2023-09-19 12:22:33 +02:00
ixp4xx-rng.c
ks-sa-rng.c
meson-rng.c
mtk-rng.c hwrng: mtk - Force runtime pm ops for sleep ops 2021-11-18 19:16:31 +01:00
mxc-rnga.c
n2-asm.S
n2-drv.c
n2rng.h
nomadik-rng.c hwrng: nomadik - keep clock enabled while hwrng is registered 2023-09-19 12:22:32 +02:00
npcm-rng.c
octeon-rng.c
omap-rng.c
omap3-rom-rng.c hwrng: omap3-rom - fix using wrong clk_disable() in omap_rom_rng_runtime_resume() 2022-06-09 10:23:11 +02:00
optee-rng.c
pasemi-rng.c
pic32-rng.c hwrng: pic32 - use devm_clk_get_enabled 2023-09-19 12:22:32 +02:00
powernv-rng.c
pseries-rng.c
s390-trng.c
st-rng.c hwrng: st - keep clock enabled while hwrng is registered 2023-07-23 13:47:17 +02:00
stm32-rng.c
timeriomem-rng.c
tx4939-rng.c
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 hwrng: virtio - Fix race on data_avail and actual data 2023-07-23 13:47:14 +02:00
xgene-rng.c
xiphera-trng.c