Skip to content

Commit e4add02

Browse files
committed
Merge tag 'random-6.9-rc5-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random
Pull random number generator fixes from Jason Donenfeld: - The input subsystem contributes entropy in some places where a spinlock is held, but the entropy accounting code only handled callers being in an interrupt or non-atomic process context, but not atomic process context. We fix this by removing an optimization and just calling queue_work() unconditionally. - Greg accidently sent up a patch not intended for his tree and that had been nack'd, so that's now reverted. * tag 'random-6.9-rc5-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random: Revert "vmgenid: emit uevent when VMGENID updates" random: handle creditable entropy from atomic process context
2 parents c2d8855 + 3aadf10 commit e4add02

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

drivers/char/random.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ static void extract_entropy(void *buf, size_t len)
702702

703703
static void __cold _credit_init_bits(size_t bits)
704704
{
705-
static struct execute_work set_ready;
705+
static DECLARE_WORK(set_ready, crng_set_ready);
706706
unsigned int new, orig, add;
707707
unsigned long flags;
708708

@@ -718,8 +718,8 @@ static void __cold _credit_init_bits(size_t bits)
718718

719719
if (orig < POOL_READY_BITS && new >= POOL_READY_BITS) {
720720
crng_reseed(NULL); /* Sets crng_init to CRNG_READY under base_crng.lock. */
721-
if (static_key_initialized)
722-
execute_in_process_context(crng_set_ready, &set_ready);
721+
if (static_key_initialized && system_unbound_wq)
722+
queue_work(system_unbound_wq, &set_ready);
723723
atomic_notifier_call_chain(&random_ready_notifier, 0, NULL);
724724
wake_up_interruptible(&crng_init_wait);
725725
kill_fasync(&fasync, SIGIO, POLL_IN);
@@ -890,8 +890,8 @@ void __init random_init(void)
890890

891891
/*
892892
* If we were initialized by the cpu or bootloader before jump labels
893-
* are initialized, then we should enable the static branch here, where
894-
* it's guaranteed that jump labels have been initialized.
893+
* or workqueues are initialized, then we should enable the static
894+
* branch here, where it's guaranteed that these have been initialized.
895895
*/
896896
if (!static_branch_likely(&crng_is_ready) && crng_init >= CRNG_READY)
897897
crng_set_ready(NULL);

drivers/virt/vmgenid.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,13 @@ static int vmgenid_add(struct acpi_device *device)
6868
static void vmgenid_notify(struct acpi_device *device, u32 event)
6969
{
7070
struct vmgenid_state *state = acpi_driver_data(device);
71-
char *envp[] = { "NEW_VMGENID=1", NULL };
7271
u8 old_id[VMGENID_SIZE];
7372

7473
memcpy(old_id, state->this_id, sizeof(old_id));
7574
memcpy(state->this_id, state->next_id, sizeof(state->this_id));
7675
if (!memcmp(old_id, state->this_id, sizeof(old_id)))
7776
return;
7877
add_vmfork_randomness(state->this_id, sizeof(state->this_id));
79-
kobject_uevent_env(&device->dev.kobj, KOBJ_CHANGE, envp);
8078
}
8179

8280
static const struct acpi_device_id vmgenid_ids[] = {

0 commit comments

Comments
 (0)