Linux 5.17.12
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.17.12 kernel.
All users of the 5.17 kernel series must upgrade.
The updated 5.17.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.17.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/admin-guide/kernel-parameters.txt | 6 Documentation/admin-guide/sysctl/kernel.rst | 22 Makefile | 2 arch/alpha/include/asm/timex.h | 1 arch/arm/include/asm/timex.h | 1 arch/ia64/include/asm/timex.h | 1 arch/m68k/include/asm/timex.h | 2 arch/mips/include/asm/timex.h | 17 arch/nios2/include/asm/timex.h | 3 arch/parisc/include/asm/timex.h | 3 arch/powerpc/include/asm/timex.h | 1 arch/riscv/include/asm/timex.h | 2 arch/s390/include/asm/timex.h | 1 arch/sparc/include/asm/timex_32.h | 4 arch/um/include/asm/timex.h | 9 arch/x86/include/asm/timex.h | 9 arch/x86/include/asm/tsc.h | 7 arch/x86/kvm/mmu/mmu.c | 6 arch/xtensa/include/asm/timex.h | 6 drivers/acpi/sysfs.c | 25 drivers/char/Kconfig | 3 drivers/char/hw_random/core.c | 1 drivers/char/random.c | 2868 +++++++++--------------- drivers/hid/amd-sfh-hid/amd_sfh_client.c | 11 drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 7 drivers/hid/amd-sfh-hid/amd_sfh_pcie.h | 4 include/linux/cpuhotplug.h | 2 include/linux/hw_random.h | 2 include/linux/mm.h | 1 include/linux/prandom.h | 23 include/linux/random.h | 100 include/linux/siphash.h | 28 include/linux/timex.h | 10 include/trace/events/random.h | 233 - init/main.c | 13 kernel/cpu.c | 11 kernel/time/timekeeping.c | 15 lib/Kconfig.debug | 3 lib/random32.c | 14 lib/siphash.c | 32 lib/vsprintf.c | 10 mm/util.c | 32 sound/pci/ctxfi/ctatc.c | 2 sound/pci/ctxfi/cthardware.h | 3 44 files changed, 1364 insertions(+), 2192 deletions(-)
Basavaraj Natikar (1):
HID: amd_sfh: Add support for sensor discovery
Dominik Brodowski (2):
random: fix locking in crng_fast_load()
random: fix locking for crng_init in crng_reseed()
Edward Matijevic (1):
ALSA: ctxfi: Add SB046x PCI ID
Eric Biggers (1):
random: remove use_input_pool parameter from crng_reseed()
Greg Kroah-Hartman (1):
Linux 5.17.12
Jan Varho (1):
random: do not split fast init input in add_hwgenerator_randomness()
Jann Horn (1):
random: check for signal_pending() outside of need_resched() check
Jason A. Donenfeld (99):
random: use computational hash for entropy extraction
random: simplify entropy debiting
random: use linear min-entropy accumulation crediting
random: always wake up entropy writers after extraction
random: make credit_entropy_bits() always safe
random: remove batched entropy locking
random: use RDSEED instead of RDRAND in entropy extraction
random: get rid of secondary crngs
random: inline leaves of rand_initialize()
random: ensure early RDSEED goes through mixer on init
random: do not xor RDRAND when writing into /dev/random
random: absorb fast pool into input pool after fast load
random: use simpler fast key erasure flow on per-cpu keys
random: use hash function for crng_slow_load()
random: make more consistent use of integer types
random: remove outdated INT_MAX >> 6 check in urandom_read()
random: zero buffer after reading entropy from userspace
random: tie batched entropy generation to base_crng generation
random: remove ifdef'd out interrupt bench
random: remove unused tracepoints
random: add proper SPDX header
random: deobfuscate irq u32/u64 contributions
random: introduce drain_entropy() helper to declutter crng_reseed()
random: remove useless header comment
random: remove whitespace and reorder includes
random: group initialization wait functions
random: group crng functions
random: group entropy extraction functions
random: group entropy collection functions
random: group userspace read/write functions
random: group sysctl functions
random: rewrite header introductory comment
random: defer fast pool mixing to worker
random: do not take pool spinlock at boot
random: unify early init crng load accounting
random: check for crng_init == 0 in add_device_randomness()
random: pull add_hwgenerator_randomness() declaration into random.h
random: clear fast pool, crng, and batches in cpuhp bring up
random: round-robin registers as ulong, not u32
random: only wake up writers after zap if threshold was passed
random: cleanup UUID handling
random: unify cycles_t and jiffies usage and types
random: do crng pre-init loading in worker rather than irq
random: give sysctl_random_min_urandom_seed a more sensible value
random: don't let 644 read-only sysctls be written to
random: replace custom notifier chain with standard one
random: use SipHash as interrupt entropy accumulator
random: make consistent usage of crng_ready()
random: reseed more often immediately after booting
random: check for signal and try earlier when generating entropy
random: skip fast_init if hwrng provides large chunk of entropy
random: treat bootloader trust toggle the same way as cpu trust toggle
random: re-add removed comment about get_random_{u32,u64} reseeding
random: mix build-time latent entropy into pool at init
random: do not allow user to keep crng key around on stack
random: check for signals every PAGE_SIZE chunk of /dev/[u]random
random: allow partial reads if later user copies fail
random: make random_get_entropy() return an unsigned long
random: document crng_fast_key_erasure() destination possibility
random: fix sysctl documentation nits
init: call time_init() before rand_initialize()
ia64: define get_cycles macro for arch-override
s390: define get_cycles macro for arch-override
parisc: define get_cycles macro for arch-override
alpha: define get_cycles macro for arch-override
powerpc: define get_cycles macro for arch-override
timekeeping: Add raw clock fallback for random_get_entropy()
m68k: use fallback for random_get_entropy() instead of zero
riscv: use fallback for random_get_entropy() instead of zero
mips: use fallback for random_get_entropy() instead of just c0 random
arm: use fallback for random_get_entropy() instead of zero
nios2: use fallback for random_get_entropy() instead of zero x86/tsc: Use fallback for random_get_entropy() instead of zero
um: use fallback for random_get_entropy() instead of zero
sparc: use fallback for random_get_entropy() instead of zero
xtensa: use fallback for random_get_entropy() instead of zero
random: insist on random_get_entropy() existing in order to simplify
random: do not use batches when !crng_ready()
random: use first 128 bits of input as fast init
random: do not pretend to handle premature next security model
random: order timer entropy functions below interrupt functions
random: do not use input pool from hard IRQs
random: help compiler out with fast_mix() by using simpler arguments
siphash: use one source of truth for siphash permutations
random: use symbolic constants for crng_init states
random: avoid initializing twice in credit race
random: move initialization out of reseeding hot path
random: remove ratelimiting for in-kernel unseeded randomness
random: use proper jiffies comparison macro
random: handle latent entropy and command line from random_init()
random: credit architectural init the exact amount
random: use static branch for crng_ready()
random: remove extern from functions in header
random: use proper return types on get_random_{int,long}_wait()
random: make consistent use of buf and len
random: move initialization functions out of hot pages
random: move randomize_page() into mm where it belongs
random: unify batched entropy implementations
random: check for signals after page of pool writes
Jens Axboe (3):
random: convert to using fops->read_iter()
random: convert to using fops->write_iter()
random: wire up fops->splice_{read,write}_iter()Lorenzo Pieralisi (1):
ACPI: sysfs: Fix BERT error region memory mapping
Paolo Bonzini (1):
KVM: x86/mmu: fix NULL pointer dereference on guest INVPCID
Greg Kroah-Hartman
maintainerDocumentation/admin-guide/kernel-parameters.txt +6 -0
@@ -4355,6 +4355,12 @@ fully seed the kernel's CRNG. Default is controlled by CONFIG_RANDOM_TRUST_CPU. + random.trust_bootloader={on,off} + [KNL] Enable or disable trusting the use of a + seed passed by the bootloader (if available) to + fully seed the kernel's CRNG. Default is controlled + by CONFIG_RANDOM_TRUST_BOOTLOADER. + randomize_kstack_offset= [KNL] Enable or disable kernel stack offset randomization, which provides roughly 5 bits of
Documentation/admin-guide/sysctl/kernel.rst +8 -14
@@ -1025,28 +1025,22 @@ This is a directory, with the following entries: * ``boot_id``: a UUID generated the first time this is retrieved, and unvarying after that; +* ``uuid``: a UUID generated every time this is retrieved (this can + thus be used to generate UUIDs at will); + * ``entropy_avail``: the pool's entropy count, in bits; * ``poolsize``: the entropy pool size, in bits; * ``urandom_min_reseed_secs``: obsolete (used to determine the minimum - number of seconds between urandom pool reseeding). - -* ``uuid``: a UUID generated every time this is retrieved (this can - thus be used to generate UUIDs at will); + number of seconds between urandom pool reseeding). This file is + writable for compatibility purposes, but writing to it has no effect + on any RNG behavior; * ``write_wakeup_threshold``: when the entropy count drops below this (as a number of bits), processes waiting to write to ``/dev/random`` - are woken up. - -If ``drivers/char/random.c`` is built with ``ADD_INTERRUPT_BENCH`` -defined, these additional entries are present: - -* ``add_interrupt_avg_cycles``: the average number of cycles between - interrupts used to feed the pool; - -* ``add_interrupt_avg_deviation``: the standard deviation seen on the - number of cycles between interrupts used to feed the pool. + are woken up. This file is writable for compatibility purposes, but + writing to it has no effect on any RNG behavior. randomize_va_space
Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 17 -SUBLEVEL = 11 +SUBLEVEL = 12 EXTRAVERSION = NAME = Superb Owl
arch/alpha/include/asm/timex.h +1 -0
@@ -28,5 +28,6 @@ static inline cycles_t get_cycles (void) __asm__ __volatile__ ("rpcc %0" :"=r" (ret)); return ret; } +#define get_cycles get_cycles#endif
arch/arm/include/asm/timex.h +1 -0
@@ -11,5 +11,6 @@typedef unsigned long cycles_t ;#define get_cycles () ({ cycles_t c; read_current_timer(&c) ? 0 : c; }) +#define random_get_entropy () (((unsigned long)get_cycles()) ?: random_get_entropy_fallback())#endif
arch/ia64/include/asm/timex.h +1 -0
@@ -39,6 +39,7 @@ get_cycles (void) ret =ia64_getreg (_IA64_REG_AR_ITC);return ret; } +#define get_cycles get_cyclesextern void ia64_cpu_local_tick (void );extern unsigned long long ia64_native_sched_clock (void );
arch/m68k/include/asm/timex.h +1 -1
@@ -35,7 +35,7 @@ static inline unsigned long random_get_entropy(void) {if (mach_random_get_entropy)return mach_random_get_entropy (); -return 0 ; +return random_get_entropy_fallback (); }#define random_get_entropy random_get_entropy
arch/mips/include/asm/timex.h +8 -9
@@ -76,25 +76,24 @@ static inline cycles_t get_cycles(void)else return 0 ;/* no usable counter */ } +#define get_cycles get_cycles/* * Like get_cycles - but where c0_count is not available we desperately * use c0_random in an attempt to get at least a little bit of entropy. -* -* R6000 and R6000A neither have a count register nor a random register. -* That leaves no entropy source in the CPU itself. */ static inline unsigned long random_get_entropy (void ) { -unsigned int prid =read_c0_prid (); -unsigned int imp = prid &PRID_IMP_MASK ; +unsigned int c0_random; -if (can_use_mips_counter (prid)) +if (can_use_mips_counter (read_c0_prid ()))return read_c0_count (); -else if (likely (imp !=PRID_IMP_R6000 && imp !=PRID_IMP_R6000A )) -return read_c0_random (); + +if (cpu_has_3kex) + c0_random = (read_c0_random () >>8 ) &0x3f ;else -return 0 ;/* no usable register */ + c0_random =read_c0_random () &0x3f ; +return (random_get_entropy_fallback () <<6 ) | (0x3f - c0_random); }#define random_get_entropy random_get_entropy
arch/nios2/include/asm/timex.h +3 -0
@@ -8,5 +8,8 @@typedef unsigned long cycles_t ;extern cycles_t get_cycles (void ); +#define get_cycles get_cycles + +#define random_get_entropy () (((unsigned long)get_cycles()) ?: random_get_entropy_fallback())#endif
arch/parisc/include/asm/timex.h +2 -1
@@ -13,9 +13,10 @@typedef unsigned long cycles_t ; -static inline cycles_t get_cycles (void ) +static inline cycles_t get_cycles (void ) {return mfctl (16 ); } +#define get_cycles get_cycles#endif
arch/powerpc/include/asm/timex.h +1 -0
@@ -19,6 +19,7 @@ static inline cycles_t get_cycles(void) {return mftb (); } +#define get_cycles get_cycles#endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_TIMEX_H */
arch/riscv/include/asm/timex.h +1 -1
@@ -41,7 +41,7 @@ static inline u32 get_cycles_hi(void)static inline unsigned long random_get_entropy (void ) {if (unlikely (clint_time_val ==NULL )) -return 0 ; +return random_get_entropy_fallback ();return get_cycles (); }#define random_get_entropy () random_get_entropy()
arch/s390/include/asm/timex.h +1 -0
@@ -201,6 +201,7 @@ static inline cycles_t get_cycles(void) {return (cycles_t )get_tod_clock () >>2 ; } +#define get_cycles get_cyclesint get_phys_clock (unsigned long *clock);void init_cpu_timer (void );
arch/sparc/include/asm/timex_32.h +1 -3
@@ -9,8 +9,6 @@#define CLOCK_TICK_RATE 1193180/* Underlying HZ */ -/* XXX Maybe do something better at some point... -DaveM */ -typedef unsigned long cycles_t ; -#define get_cycles () (0) +#include <asm-generic/timex.h> #endif
arch/um/include/asm/timex.h +2 -7
@@ -2,13 +2,8 @@#ifndef __UM_TIMEX_H#define __UM_TIMEX_H -typedef unsigned long cycles_t ; - -static inline cycles_t get_cycles (void ) -{ -return 0 ; -} -#define CLOCK_TICK_RATE (HZ) +#include <asm-generic/timex.h> +#endif
arch/x86/include/asm/timex.h +9 -0
@@ -5,6 +5,15 @@#include <asm/processor.h> #include <asm/tsc.h> +static inline unsigned long random_get_entropy (void ) +{ +if (!IS_ENABLED (CONFIG_X86_TSC ) && + !cpu_feature_enabled (X86_FEATURE_TSC )) +return random_get_entropy_fallback (); +return rdtsc (); +} +#define random_get_entropy random_get_entropy +/* Assume we use the PIT time source for the clock tick */ #define CLOCK_TICK_RATE PIT_TICK_RATE
arch/x86/include/asm/tsc.h +3 -4
@@ -20,13 +20,12 @@ extern void disable_TSC(void);static inline cycles_t get_cycles (void ) { -#ifndef CONFIG_X86_TSC -if (!boot_cpu_has (X86_FEATURE_TSC )) +if (!IS_ENABLED (CONFIG_X86_TSC ) && + !cpu_feature_enabled (X86_FEATURE_TSC ))return 0 ; -#endif -return rdtsc (); } +#define get_cycles get_cyclesextern struct system_counterval_t convert_art_to_tsc (u64 art);extern struct system_counterval_t convert_art_ns_to_tsc (u64 art_ns);
arch/x86/kvm/mmu/mmu.c +4 -2
@@ -5416,14 +5416,16 @@ void kvm_mmu_invpcid_gva(struct kvm_vcpu *vcpu, gva_t gva, unsigned long pcid)uint i;if (pcid ==kvm_get_active_pcid (vcpu)) { - mmu->invlpg (vcpu, gva, mmu->root_hpa); +if (mmu->invlpg) + mmu->invlpg (vcpu, gva, mmu->root_hpa); tlb_flush = true; }for (i =0 ; i <KVM_MMU_NUM_PREV_ROOTS ; i++) {if (VALID_PAGE (mmu->prev_roots[i].hpa) && pcid ==kvm_get_pcid (vcpu, mmu->prev_roots[i].pgd)) { - mmu->invlpg (vcpu, gva, mmu->prev_roots[i].hpa); +if (mmu->invlpg) + mmu->invlpg (vcpu, gva, mmu->prev_roots[i].hpa); tlb_flush = true; } }
arch/xtensa/include/asm/timex.h +2 -4
@@ -29,10 +29,6 @@extern unsigned long ccount_freq; -typedef unsigned long long cycles_t ; - -#define get_cycles () (0) -void local_timer_setup (unsigned cpu);/*
@@ -59,4 +55,6 @@ static inline void set_linux_timer (unsigned long ccompare) xtensa_set_sr(ccompare, SREG_CCOMPARE + LINUX_TIMER); } +#include <asm-generic/timex.h> +#endif /* _XTENSA_TIMEX_H */
drivers/acpi/sysfs.c +18 -7
@@ -415,19 +415,30 @@ static ssize_t acpi_data_show(struct file *filp, struct kobject *kobj, loff_t offset, size_t count) {struct acpi_data_attr *data_attr; -void *base; -ssize_t rc; +void __iomem *base; +ssize_t size; data_attr = container_of(bin_attr, struct acpi_data_attr, attr); + size = data_attr->attr.size; + +if (offset <0 ) +return -EINVAL ; + +if (offset >= size) +return 0 ; - base =acpi_os_map_memory (data_attr->addr, data_attr->attr.size); +if (count > size - offset) + count = size - offset; + + base =acpi_os_map_iomem (data_attr->addr, size);if (!base)return -ENOMEM ; - rc =memory_read_from_buffer (buf, count, &offset, base, - data_attr->attr.size); -acpi_os_unmap_memory (base, data_attr->attr.size); -return rc; +memcpy_fromio (buf, base + offset, count); + +acpi_os_unmap_iomem (base, size); + +return count; }static int acpi_bert_data_init (void *th,struct acpi_data_attr *data_attr)
drivers/char/Kconfig +2 -1
@@ -449,6 +449,7 @@ config RANDOM_TRUST_BOOTLOADER device randomness. Say Y here to assume the entropy provided by the booloader is trustworthy so it will be added to the kernel's entropy pool. Otherwise, say N here so it will be regarded as device input that - only mixes the entropy pool. + only mixes the entropy pool. This can also be configured at boot with + "random.trust_bootloader=on/off". endmenu
drivers/char/hw_random/core.c +1 -0
@@ -15,6 +15,7 @@#include <linux/err.h> #include <linux/fs.h> #include <linux/hw_random.h> +#include <linux/random.h> #include <linux/kernel.h> #include <linux/kthread.h> #include <linux/sched/signal.h>
drivers/char/random.c +1087 -1781
2,702 lines not on this page · raw message
drivers/hid/amd-sfh-hid/amd_sfh_client.c +11 -0
Lines of this file are not shown. View the raw message.
include/linux/random.h +40 -60
100 lines not on this page · raw message
include/trace/events/random.h deleted +0 -233
233 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.