From b8aa74aed9fa008b908682bfa085461635e876e0 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Thu, 16 Mar 2023 13:21:19 +0200 Subject: [PATCH 2/3] random: disable interrupt random source Interrupts in our UML environment are signals, which can be delivered at somewhat random times depending on host scheduling. Disable these as a source to make the random reproducible between runs. Signed-off-by: Benjamin Berg --- drivers/char/random.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/char/random.c b/drivers/char/random.c index 253f2ddb8913..db2c5a296c05 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1093,6 +1093,9 @@ void add_interrupt_randomness(int irq) struct pt_regs *regs = get_irq_regs(); unsigned int new_count; + /* UML seems to not always get the signals entirely at the same time */ + return; + fast_mix(fast_pool->pool, entropy, (regs ? instruction_pointer(regs) : _RET_IP_) ^ swab(irq)); new_count = ++fast_pool->count; -- 2.41.0