android_kernel_motorola_sm6375/drivers/char
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jason A. Donenfeld 5e126f6880 random: do not throw away excess input to crng_fast_load
[ Upstream commit 73c7733f122e8d0107f88655a12011f68f69e74b ]

When crng_fast_load() is called by add_hwgenerator_randomness(), we
currently will advance to crng_init==1 once we've acquired 64 bytes, and
then throw away the rest of the buffer. Usually, that is not a problem:
When add_hwgenerator_randomness() gets called via EFI or DT during
setup_arch(), there won't be any IRQ randomness. Therefore, the 64 bytes
passed by EFI exactly matches what is needed to advance to crng_init==1.
Usually, DT seems to pass 64 bytes as well -- with one notable exception
being kexec, which hands over 128 bytes of entropy to the kexec'd kernel.
In that case, we'll advance to crng_init==1 once 64 of those bytes are
consumed by crng_fast_load(), but won't continue onward feeding in bytes
to progress to crng_init==2. This commit fixes the issue by feeding
any leftover bytes into the next phase in add_hwgenerator_randomness().

[linux@dominikbrodowski.net: rewrite commit message]
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-01-27 09:19:46 +01:00
..
agp parisc/agp: Annotate parisc agp init functions with __init 2021-12-17 10:12:23 +01:00
hw_random hwrng: mtk - Force runtime pm ops for sleep ops 2021-11-17 09:48:37 +01:00
ipmi ipmi: fix initialization when workqueue allocation fails 2021-12-29 12:23:36 +01:00
mwave char/mwave: Adjust io port register size 2022-01-27 09:19:38 +01:00
pcmcia char: pcmcia: error out if 'num_bytes_read' is greater than 4 in set_protocol() 2021-07-14 16:53:40 +02:00
tpm tpm: add request_locality before write TPM_INT_ENABLE 2022-01-27 09:19:37 +01:00
xilinx_hwicap
xillybus
adi.c
apm-emulation.c
applicom.c
applicom.h
bsr.c
ds1620.c
dsp56k.c
dtlk.c
efirtc.c
hangcheck-timer.c
hpet.c char: hpet: add checks after calling ioremap 2021-06-03 08:59:09 +02:00
Kconfig
lp.c
Makefile
mem.c
misc.c
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 random: do not throw away excess input to crng_fast_load 2022-01-27 09:19:46 +01:00
raw.c
rtc.c
scx200_gpio.c
sonypi.c
tb0219.c
tlclk.c drivers: char: tlclk.c: Avoid data race between init and interrupt handler 2020-10-01 13:17:56 +02:00
toshiba.c
ttyprintk.c ttyprintk: Add TTY hangup callback. 2021-05-14 09:44:23 +02:00
uv_mmtimer.c
virtio_console.c virtio_console: Assure used length from device is limited 2021-07-20 16:10:49 +02:00