android_kernel_motorola_sm6375/drivers/char
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jason A. Donenfeld c8b06c9242
UPSTREAM: random: split initialization into early step and later step
The full RNG initialization relies on some timestamps, made possible
with initialization functions like time_init() and timekeeping_init().
However, these are only available rather late in initialization.
Meanwhile, other things, such as memory allocator functions, make use of
the RNG much earlier.

So split RNG initialization into two phases. We can provide arch
randomness very early on, and then later, after timekeeping and such are
available, initialize the rest.

This ensures that, for example, slabs are properly randomized if RDRAND
is available. Without this, CONFIG_SLAB_FREELIST_RANDOM=y loses a degree
of its security, because its random seed is potentially deterministic,
since it hasn't yet incorporated RDRAND. It also makes it possible to
use a better seed in kfence, which currently relies on only the cycle
counter.

Another positive consequence is that on systems with RDRAND, running
with CONFIG_WARN_ALL_UNSEEDED_RANDOM=y results in no warnings at all.

One subtle side effect of this change is that on systems with no RDRAND,
RDTSC is now only queried by random_init() once, committing the moment
of the function call, instead of multiple times as before. This is
intentional, as the multiple RDTSCs in a loop before weren't
accomplishing very much, with jitter being better provided by
try_to_generate_entropy(). Plus, filling blocks with RDTSC is still
being done in extract_entropy(), which is necessarily called before
random bytes are served anyway.

Cc: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
(cherry picked from commit f62384995e4cb7703e5295779c44135c5311770d)
Change-Id: Ibf5ca2ddea8d853c108c6191803046cae8808dfa
[dereference23: Backport to 5.4]
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2026-05-07 17:24:10 +03:00
..
agp Merge 1d28224d49 ("selftests/ftrace: Correctly enable event in instance-event.tc") into android11-5.4-lts 2023-10-24 16:45:58 +00:00
hw_random Merge android11-5.4.302(91d385eb) into msm-5.4 2026-01-30 11:41:11 +05:30
ipmi ipmi: Fix strcpy source and destination the same 2025-08-28 16:21:29 +02:00
mwave
pcmcia
tpm tpm_tis: Fix incorrect arguments in tpm_tis_probe_irq_single 2025-10-29 13:59:52 +01:00
virtio_eavb char: virtio_eavb: use new update_marker api 2023-08-15 11:24:49 +05:30
xilinx_hwicap
xillybus
adi.c
adsprpc.c Merge tag 'LA.UM.9.14.1.r1-21100-QCM6490.QISI15.0' of https://git.codelinaro.org/clo/la/kernel/msm-5.4 into android13-5.4-lahaina 2026-04-30 20:46:30 +03:00
adsprpc_compat.c
adsprpc_compat.h
adsprpc_shared.h
apm-emulation.c
applicom.c
applicom.h
bsr.c
ds1620.c
dsp56k.c
dtlk.c
efirtc.c
fastcvpd.c
hangcheck-timer.c
hpet.c hpet: Support 32-bit userspace 2024-07-18 11:40:55 +02:00
Kconfig
lp.c
Makefile
mem.c BACKPORT: maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault 2026-01-14 18:13:21 -08:00
misc.c This is the 5.4.302 stable release 2025-12-11 09:41:30 +00:00
msm_smd_pkt.c
mspec.c
nsc_gpio.c
nvram.c
nwbutton.c
nwbutton.h
nwflash.c
pc8736x_gpio.c
powernv-op-panel.c
ppdev.c ppdev: Add an error check in register_device 2024-06-16 13:28:43 +02:00
ps3flash.c
random.c UPSTREAM: random: split initialization into early step and later step 2026-05-07 17:24:10 +03:00
raw.c
rdbg.c
rtc.c
scx200_gpio.c
sonypi.c
tb0219.c
tlclk.c
toshiba.c
ttyprintk.c
uv_mmtimer.c
virtio_console.c virtio_console: fix missing byte order handling for cols and rows 2025-05-02 07:39:26 +02:00
virtio_fastrpc.c