From 952820c53964a3ee6fdca94e15771eb1097c87be Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 18 Dec 2019 16:29:49 -0500 Subject: gnu: linux-libre: Update to 5.4.5. * gnu/packages/aux-files/linux-libre/5.3-arm-veyron.conf, gnu/packages/aux-files/linux-libre/5.3-arm.conf, gnu/packages/aux-files/linux-libre/5.3-arm64.conf, gnu/packages/aux-files/linux-libre/5.3-i686.conf, gnu/packages/aux-files/linux-libre/5.3-x86_64.conf: Delete files. * gnu/packages/aux-files/linux-libre/5.4-arm-veyron.conf, gnu/packages/aux-files/linux-libre/5.4-arm.conf, gnu/packages/aux-files/linux-libre/5.4-arm64.conf, gnu/packages/aux-files/linux-libre/5.4-i686.conf, gnu/packages/aux-files/linux-libre/5.4-x86_64.conf: New files. * Makefile.am (AUX_FILES): Update accordingly. * gnu/packages/patches/linux-libre-active-entropy.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. * gnu/packages/linux.scm (deblob-scripts-5.3, linux-libre-5.3-version) (linux-libre-5.3-pristine-source, linux-libre-5.3-source) (linux-libre-headers-5.3, linux-libre-5.3): Remove variables. (deblob-scripts-5.4, linux-libre-5.4-version) (linux-libre-5.4-pristine-source, linux-libre-5.4-source) (linux-libre-headers-5.4, linux-libre-5.4): New variables. (linux-libre-version, linux-libre-pristine-source) (linux-libre-source, linux-libre): Point to linux-libre-5.4*. --- .../patches/linux-libre-active-entropy.patch | 86 ---------------------- 1 file changed, 86 deletions(-) delete mode 100644 gnu/packages/patches/linux-libre-active-entropy.patch (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/linux-libre-active-entropy.patch b/gnu/packages/patches/linux-libre-active-entropy.patch deleted file mode 100644 index 8f081f4a19..0000000000 --- a/gnu/packages/patches/linux-libre-active-entropy.patch +++ /dev/null @@ -1,86 +0,0 @@ -Try to actively add entropy instead of waiting forever. -Fixes . - -Taken from upstream: -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/?id=50ee7529ec4500c88f8664560770a7a1b65db72b - -diff --git a/drivers/char/random.c b/drivers/char/random.c -index 5d5ea4ce1442..2fda6166c1dd 100644 ---- a/drivers/char/random.c -+++ b/drivers/char/random.c -@@ -1731,6 +1731,56 @@ void get_random_bytes(void *buf, int nbytes) - } - EXPORT_SYMBOL(get_random_bytes); - -+ -+/* -+ * Each time the timer fires, we expect that we got an unpredictable -+ * jump in the cycle counter. Even if the timer is running on another -+ * CPU, the timer activity will be touching the stack of the CPU that is -+ * generating entropy.. -+ * -+ * Note that we don't re-arm the timer in the timer itself - we are -+ * happy to be scheduled away, since that just makes the load more -+ * complex, but we do not want the timer to keep ticking unless the -+ * entropy loop is running. -+ * -+ * So the re-arming always happens in the entropy loop itself. -+ */ -+static void entropy_timer(struct timer_list *t) -+{ -+ credit_entropy_bits(&input_pool, 1); -+} -+ -+/* -+ * If we have an actual cycle counter, see if we can -+ * generate enough entropy with timing noise -+ */ -+static void try_to_generate_entropy(void) -+{ -+ struct { -+ unsigned long now; -+ struct timer_list timer; -+ } stack; -+ -+ stack.now = random_get_entropy(); -+ -+ /* Slow counter - or none. Don't even bother */ -+ if (stack.now == random_get_entropy()) -+ return; -+ -+ timer_setup_on_stack(&stack.timer, entropy_timer, 0); -+ while (!crng_ready()) { -+ if (!timer_pending(&stack.timer)) -+ mod_timer(&stack.timer, jiffies+1); -+ mix_pool_bytes(&input_pool, &stack.now, sizeof(stack.now)); -+ schedule(); -+ stack.now = random_get_entropy(); -+ } -+ -+ del_timer_sync(&stack.timer); -+ destroy_timer_on_stack(&stack.timer); -+ mix_pool_bytes(&input_pool, &stack.now, sizeof(stack.now)); -+} -+ - /* - * Wait for the urandom pool to be seeded and thus guaranteed to supply - * cryptographically secure random numbers. This applies to: the /dev/urandom -@@ -1745,7 +1795,17 @@ int wait_for_random_bytes(void) - { - if (likely(crng_ready())) - return 0; -- return wait_event_interruptible(crng_init_wait, crng_ready()); -+ -+ do { -+ int ret; -+ ret = wait_event_interruptible_timeout(crng_init_wait, crng_ready(), HZ); -+ if (ret) -+ return ret > 0 ? 0 : ret; -+ -+ try_to_generate_entropy(); -+ } while (!crng_ready()); -+ -+ return 0; - } - EXPORT_SYMBOL(wait_for_random_bytes); - -- cgit 1.4.1