mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 04:34:08 +08:00
0b9ba6135d
UML generally does not provide access to special CPU instructions like RDRAND, and execution tends to be rather deterministic, with no real hardware interrupts, making good randomness really very hard, if not all together impossible. Not only is this a security eyebrow raiser, but it's also quite annoying when trying to do various pieces of UML-based automation that takes a long time to boot, if ever. Fix this by trivially calling getrandom() in the host and using that seed as "bootloader randomness", which initializes the rng immediately at UML boot. The old behavior can be restored the same way as on any other arch, by way of CONFIG_TRUST_BOOTLOADER_RANDOMNESS=n or random.trust_bootloader=0. So seen from that perspective, this just makes UML act like other archs, which is positive in its own right. Additionally, wire up arch_get_random_{int,long}() in the same way, so that reseeds can also make use of the host RNG, controllable by CONFIG_TRUST_CPU_RANDOMNESS and random.trust_cpu, per usual. Cc: stable@vger.kernel.org Acked-by: Johannes Berg <johannes@sipsolutions.net> Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> |
||
---|---|---|
.. | ||
skas | ||
asm-offsets.c | ||
config.c.in | ||
dtb.c | ||
dyn.lds.S | ||
early_printk.c | ||
exec.c | ||
exitcode.c | ||
gprof_syms.c | ||
initrd.c | ||
ioport.c | ||
irq.c | ||
kmsg_dump.c | ||
ksyms.c | ||
load_file.c | ||
maccess.c | ||
Makefile | ||
mem.c | ||
physmem.c | ||
process.c | ||
ptrace.c | ||
reboot.c | ||
sigio.c | ||
signal.c | ||
stacktrace.c | ||
sysrq.c | ||
time.c | ||
tlb.c | ||
trap.c | ||
um_arch.c | ||
um_arch.h | ||
umid.c | ||
uml.lds.S | ||
vmlinux.lds.S |