Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'random-6.2-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random

Pull more random number generator updates from Jason Donenfeld:
"Two remaining changes that are now possible after you merged a few
other trees:

- #include <asm/archrandom.h> can be removed from random.h now,
making the direct use of the arch_random_* API more of a private
implementation detail between the archs and random.c, rather than
something for general consumers.

- Two additional uses of prandom_u32_max() snuck in during the
initial phase of pulls, so these have been converted to
get_random_u32_below(), and now the deprecated prandom_u32_max()
alias -- which was just a wrapper around get_random_u32_below() --
can be removed.

In addition, there is one fix:

- Check efi_rt_services_supported() before attempting to use an EFI
runtime function.

This affected EFI systems that disable runtime services yet still
boot via EFI (e.g. the reporter's Lenovo Thinkpad X13s laptop), as
well systems where EFI runtime services have been forcibly
disabled, such as on PREEMPT_RT.

On those machines, a very early and hard to diagnose crash would
happen, preventing boot"

* tag 'random-6.2-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random:
prandom: remove prandom_u32_max()
efi: random: fix NULL-deref when refreshing seed
random: do not include <asm/archrandom.h> from random.h

+10 -11
+1
arch/powerpc/kernel/setup-common.c
··· 59 59 #include <asm/xmon.h> 60 60 #include <asm/cputhreads.h> 61 61 #include <mm/mmu_decl.h> 62 + #include <asm/archrandom.h> 62 63 #include <asm/fadump.h> 63 64 #include <asm/udbg.h> 64 65 #include <asm/hugetlb.h>
+1
arch/s390/kernel/setup.c
··· 52 52 #include <linux/hugetlb.h> 53 53 #include <linux/kmemleak.h> 54 54 55 + #include <asm/archrandom.h> 55 56 #include <asm/boot_data.h> 56 57 #include <asm/ipl.h> 57 58 #include <asm/facility.h>
+1 -1
arch/x86/mm/cpu_entry_area.c
··· 36 36 unsigned int cea; 37 37 38 38 again: 39 - cea = prandom_u32_max(max_cea); 39 + cea = get_random_u32_below(max_cea); 40 40 41 41 for_each_possible_cpu(j) { 42 42 if (cea_offset(j) == cea)
+1
drivers/char/hw_random/powernv-rng.c
··· 11 11 #include <linux/platform_device.h> 12 12 #include <linux/random.h> 13 13 #include <linux/hw_random.h> 14 + #include <asm/archrandom.h> 14 15 15 16 static int powernv_rng_read(struct hwrng *rng, void *data, size_t max, bool wait) 16 17 {
+1
drivers/char/hw_random/s390-trng.c
··· 23 23 #include <linux/sched/signal.h> 24 24 #include <asm/debug.h> 25 25 #include <asm/cpacf.h> 26 + #include <asm/archrandom.h> 26 27 27 28 MODULE_LICENSE("GPL v2"); 28 29 MODULE_AUTHOR("IBM Corporation");
+1
drivers/char/random.c
··· 56 56 #include <linux/sched/isolation.h> 57 57 #include <crypto/chacha.h> 58 58 #include <crypto/blake2s.h> 59 + #include <asm/archrandom.h> 59 60 #include <asm/processor.h> 60 61 #include <asm/irq.h> 61 62 #include <asm/irq_regs.h>
+3 -1
drivers/firmware/efi/efi.c
··· 429 429 platform_device_register_simple("efi_secret", 0, NULL, 0); 430 430 #endif 431 431 432 - execute_with_initialized_rng(&refresh_nv_rng_seed_nb); 432 + if (efi_rt_services_supported(EFI_RT_SUPPORTED_SET_VARIABLE)) 433 + execute_with_initialized_rng(&refresh_nv_rng_seed_nb); 434 + 433 435 return 0; 434 436 435 437 err_remove_group:
-6
include/linux/prandom.h
··· 24 24 #define prandom_init_once(pcpu_state) \ 25 25 DO_ONCE(prandom_seed_full_state, (pcpu_state)) 26 26 27 - /* Deprecated: use get_random_u32_below() instead. */ 28 - static inline u32 prandom_u32_max(u32 ep_ro) 29 - { 30 - return get_random_u32_below(ep_ro); 31 - } 32 - 33 27 /* 34 28 * Handle minimum values for seeds 35 29 */
-2
include/linux/random.h
··· 152 152 */ 153 153 #include <linux/prandom.h> 154 154 155 - #include <asm/archrandom.h> 156 - 157 155 #ifdef CONFIG_SMP 158 156 int random_prepare_cpu(unsigned int cpu); 159 157 int random_online_cpu(unsigned int cpu);
+1 -1
net/ipv4/tcp_plb.c
··· 97 97 return; 98 98 99 99 pause = READ_ONCE(net->ipv4.sysctl_tcp_plb_suspend_rto_sec) * HZ; 100 - pause += prandom_u32_max(pause); 100 + pause += get_random_u32_below(pause); 101 101 plb->pause_until = tcp_jiffies32 + pause; 102 102 103 103 /* Reset PLB state upon RTO, since an RTO causes a sk_rethink_txhash() call