linux-stable/drivers/char
Herbert Xu aa8aa16ed9 hwrng: core - Fix page fault dead lock on mmap-ed hwrng
commit 78aafb3884 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-01-31 16:16:58 -08:00
..
agp parisc: sba: Fix compile warning wrt list of SBA devices 2023-10-06 14:56:51 +02:00
hw_random hwrng: core - Fix page fault dead lock on mmap-ed hwrng 2024-01-31 16:16:58 -08:00
ipmi ipmi_si: fix a memleak in try_smi_init() 2023-09-13 09:43:00 +02:00
mwave
pcmcia Revert "char: pcmcia: cm4000_cs: Replace mdelay with usleep_range in set_protocol" 2023-03-10 09:33:32 +01:00
tpm tpm_tis: Resend command to recover from data transfer errors 2023-09-23 11:11:02 +02:00
xilinx_hwicap
xillybus char: xillybus: fix a refcount leak in cleanup_dev() 2022-04-24 17:30:45 +02:00
Kconfig Char / Misc driver changes for 6.0-rc1 2022-08-04 11:05:48 -07:00
Makefile char: remove VR41XX related char driver 2022-07-28 16:12:33 +02:00
adi.c
apm-emulation.c apm-emulation: drop unexpected word "the" in the comments 2022-06-27 16:15:27 +02:00
applicom.c applicom: Fix PCI device refcount leak in applicom_init() 2023-03-10 09:33:32 +01:00
applicom.h
bsr.c
ds1620.c
dsp56k.c
dtlk.c
hangcheck-timer.c
hpet.c
lp.c char: lp: remove redundant initialization of err 2022-06-10 15:29:50 +02:00
mem.c random: restore O_NONBLOCK support 2022-09-23 12:27:57 +02:00
misc.c char: misc: remove usage of list iterator past the loop body 2022-04-24 17:15:12 +02:00
mspec.c
nsc_gpio.c
nvram.c
nwbutton.c
nwbutton.h
nwflash.c
pc8736x_gpio.c
powernv-op-panel.c
ppdev.c
ps3flash.c
random.c use less confusing names for iov_iter direction initializers 2023-02-09 11:28:04 +01:00
scx200_gpio.c
sonypi.c
tlclk.c
toshiba.c
ttyprintk.c char: ttyprintk: register console 2022-04-22 16:24:47 +02:00
uv_mmtimer.c
virtio_console.c Char/Misc and other driver updates for 5.18-rc1 2022-03-28 12:27:35 -07:00