Skip to content

Commit 69cbeb6

Browse files
committed
Revert "efi: random: refresh non-volatile random seed when RNG is initialized"
This reverts commit e7b813b (and the subsequent fix for it: 41a1585 "efi: random: fix NULL-deref when refreshing seed"). It turns otu to cause non-deterministic boot stalls on at least a HP 6730b laptop. Reported-and-bisected-by: Sami Korkalainen <[email protected]> Link: https://lore.kernel.org/all/GQUnKz2al3yke5mB2i1kp3SzNHjK8vi6KJEh7rnLrOQ24OrlljeCyeWveLW9pICEmB9Qc8PKdNt3w1t_g3-Uvxq1l8Wj67PpoMeWDoH8PKk=@proton.me/ Cc: Jason A. Donenfeld <[email protected]> Cc: Bagas Sanjaya <[email protected]> Cc: [email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent 2214170 commit 69cbeb6

File tree

1 file changed

+0
-21
lines changed
  • drivers/firmware/efi

1 file changed

+0
-21
lines changed

drivers/firmware/efi/efi.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -361,24 +361,6 @@ static void __init efi_debugfs_init(void)
361361
static inline void efi_debugfs_init(void) {}
362362
#endif
363363

364-
static void refresh_nv_rng_seed(struct work_struct *work)
365-
{
366-
u8 seed[EFI_RANDOM_SEED_SIZE];
367-
368-
get_random_bytes(seed, sizeof(seed));
369-
efi.set_variable(L"RandomSeed", &LINUX_EFI_RANDOM_SEED_TABLE_GUID,
370-
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS |
371-
EFI_VARIABLE_RUNTIME_ACCESS, sizeof(seed), seed);
372-
memzero_explicit(seed, sizeof(seed));
373-
}
374-
static int refresh_nv_rng_seed_notification(struct notifier_block *nb, unsigned long action, void *data)
375-
{
376-
static DECLARE_WORK(work, refresh_nv_rng_seed);
377-
schedule_work(&work);
378-
return NOTIFY_DONE;
379-
}
380-
static struct notifier_block refresh_nv_rng_seed_nb = { .notifier_call = refresh_nv_rng_seed_notification };
381-
382364
/*
383365
* We register the efi subsystem with the firmware subsystem and the
384366
* efivars subsystem with the efi subsystem, if the system was booted with
@@ -451,9 +433,6 @@ static int __init efisubsys_init(void)
451433
platform_device_register_simple("efi_secret", 0, NULL, 0);
452434
#endif
453435

454-
if (efi_rt_services_supported(EFI_RT_SUPPORTED_SET_VARIABLE))
455-
execute_with_initialized_rng(&refresh_nv_rng_seed_nb);
456-
457436
return 0;
458437

459438
err_remove_group:

0 commit comments

Comments
 (0)