Skip to contentSkip to conversation

Linux 5.10.119

DISCUSSION Greg Kroah-Hartman 1 participant 2 messages May 30, 2022 Stable branch

lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

I'm announcing the release of the 5.10.119 kernel.

All users of the 5.10 kernel series must upgrade.

The updated 5.10.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.10.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 
 MAINTAINERS                                     |    2 
 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/crypto/Makefile                        |    4 
 arch/x86/crypto/blake2s-glue.c                  |  166 -
 arch/x86/crypto/blake2s-shash.c                 |   77 
 arch/x86/include/asm/timex.h                    |    9 
 arch/x86/include/asm/tsc.h                      |    7 
 arch/x86/kernel/cpu/mshyperv.c                  |    2 
 arch/x86/kvm/lapic.c                            |    6 
 arch/x86/kvm/mmu/mmu.c                          |    6 
 arch/x86/kvm/x86.c                              |    2 
 arch/xtensa/include/asm/timex.h                 |    6 
 crypto/Kconfig                                  |    3 
 crypto/blake2s_generic.c                        |  158 -
 crypto/drbg.c                                   |   17 
 drivers/acpi/sysfs.c                            |   23 
 drivers/char/Kconfig                            |    3 
 drivers/char/hw_random/core.c                   |    1 
 drivers/char/random.c                           | 3035 ++++++++----------------
 drivers/hv/vmbus_drv.c                          |    2 
 drivers/media/test-drivers/vim2m.c              |   22 
 drivers/net/Kconfig                             |    1 
 drivers/net/wireguard/noise.c                   |   45 
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c  |    6 
 include/crypto/blake2s.h                        |   66 
 include/crypto/chacha.h                         |   15 
 include/crypto/drbg.h                           |    2 
 include/crypto/internal/blake2s.h               |  123 
 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/security.h                        |    2 
 include/linux/siphash.h                         |   28 
 include/linux/timex.h                           |   10 
 include/net/inet_hashtables.h                   |    2 
 include/net/secure_seq.h                        |    4 
 include/trace/events/random.h                   |  330 --
 init/main.c                                     |   13 
 kernel/cpu.c                                    |   11 
 kernel/debug/debug_core.c                       |   24 
 kernel/debug/kdb/kdb_main.c                     |   62 
 kernel/irq/handle.c                             |    2 
 kernel/time/timekeeping.c                       |   15 
 lib/Kconfig.debug                               |    3 
 lib/crypto/Kconfig                              |   23 
 lib/crypto/Makefile                             |    9 
 lib/crypto/blake2s-generic.c                    |    6 
 lib/crypto/blake2s-selftest.c                   |   33 
 lib/crypto/blake2s.c                            |   81 
 lib/random32.c                                  |   16 
 lib/sha1.c                                      |   95 
 lib/siphash.c                                   |   32 
 lib/vsprintf.c                                  |   10 
 mm/util.c                                       |   32 
 net/core/secure_seq.c                           |    4 
 net/ipv4/inet_hashtables.c                      |   28 
 net/ipv6/inet6_hashtables.c                     |    4 
 security/security.c                             |    2 
 sound/pci/ctxfi/ctatc.c                         |    2 
 sound/pci/ctxfi/cthardware.h                    |    3 
 76 files changed, 1864 insertions(+), 3034 deletions(-)

Andy Shevchenko (1):
ACPI: sysfs: Make sparse happy about address space in use

Ard Biesheuvel (1):
random: avoid arch_get_random_seed_long() when collecting IRQ randomness

Daniel Thompson (1):
lockdown: also lock down previous kgdb use

Denis Efremov (Oracle) (1):

      staging: rtl8723bs: prevent ->Ssid overflow in rtw_wx_set_scan()

Dominik Brodowski (7):
random: harmonize "crng init done" messages
random: early initialization of ChaCha constants
random: continually use hwgenerator randomness
random: access primary_pool directly rather than through pointer
random: only call crng_finalize_init() for primary_crng
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 (11):
random: remove dead code left over from blocking pool
crypto: blake2s - define shash_alg structs using macros
crypto: x86/blake2s - define shash_alg structs using macros
crypto: blake2s - remove unneeded includes
crypto: blake2s - move update and final logic to internal/blake2s.h
crypto: blake2s - share the "shash" API boilerplate code
crypto: blake2s - optimize blake2s initialization
crypto: blake2s - add comment for blake2s_state fields
crypto: blake2s - adjust include guard naming
crypto: blake2s - include <linux/bug.h> instead of <asm/bug.h>
random: remove use_input_pool parameter from crng_reseed()

Eric Dumazet (1):
tcp: change source port randomizarion at connect() time

Greg Kroah-Hartman (1):

      Linux 5.10.119

Hans Verkuil (1):
media: vim2m: initialize the media device earlier

Herbert Xu (1):
crypto: lib/blake2s - Move selftest prototype into header file

Jan Varho (1):
random: do not split fast init input in add_hwgenerator_randomness()

Jann Horn (2):
random: don't reset crng_init_cnt on urandom_read()
random: check for signal_pending() outside of need_resched() check

Jason A. Donenfeld (123):
MAINTAINERS: co-maintain random.c
MAINTAINERS: add git tree for random.c
lib/crypto: blake2s: include as built-in
lib/crypto: blake2s: move hmac construction into wireguard lib/crypto: sha1: re-roll loops to reduce code size
lib/crypto: blake2s: avoid indirect calls to compression function for Clang CFI
random: use BLAKE2s instead of SHA1 in extraction
random: do not sign extend bytes for rotation when mixing
random: do not re-init if crng_reseed completes before primary init
random: mix bootloader randomness into pool
random: use IS_ENABLED(CONFIG_NUMA) instead of ifdefs
random: avoid superfluous call to RDRAND in CRNG extraction
random: cleanup poolinfo abstraction
random: cleanup integer types
random: remove incomplete last_data logic
random: remove unused extract_entropy() reserved argument
random: rather than entropy_store abstraction, use global
random: remove unused OUTPUT_POOL constants
random: de-duplicate INPUT_POOL constants
random: prepend remaining pool constants with POOL_
random: cleanup fractional entropy shift constants
random: access input_pool_data directly rather than through pointer
random: selectively clang-format where it makes sense
random: simplify arithmetic function flow in account()
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

Mark Brown (1):
random: document add_hwgenerator_randomness() with other input functions

Paolo Bonzini (1):
KVM: x86/mmu: fix NULL pointer dereference on guest INVPCID

Sakari Ailus (1):
media: vim2m: Register video device after setting up internals

Schspa Shi (1):
random: fix typo in comments

Sebastian Andrzej Siewior (1):
random: remove unused irq_flags argument from add_interrupt_randomness()

Vitaly Kuznetsov (1):
KVM: x86: Properly handle APF vs disabled LAPIC situation

Willy Tarreau (1):
secure_seq: use the 64 bits of the siphash for port offset calculation

author maintainer
#1 lore raw
Documentation/admin-guide/kernel-parameters.txt +6 -0
index 611172f68bb5..5e34deec819f 100644
@@ -4035,6 +4035,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.
+
 	ras=option[,option,...]	[KNL] RAS-specific options
 
 		cec_disable	[X86]
Documentation/admin-guide/sysctl/kernel.rst +8 -14
index e338306f4587..a4b1ebc2e70b 100644
@@ -1006,28 +1006,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
MAINTAINERS +2 -0
index c64c9354c287..7c118b507912 100644
@@ -14671,6 +14671,8 @@ F:	arch/mips/generic/board-ranchu.c
 
 RANDOM NUMBER DRIVER
 M:	"Theodore Ts'o" <[email protected]>
+M:	Jason A. Donenfeld <[email protected]>
+T:	git https://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git
 S:	Maintained
 F:	drivers/char/random.c
 
Makefile +1 -1
index f9210e43121d..b442cc5bbfc3 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 VERSION = 5
 PATCHLEVEL = 10
-SUBLEVEL = 118
+SUBLEVEL = 119
 EXTRAVERSION =
 NAME = Dare mighty things
 
arch/alpha/include/asm/timex.h +1 -0
index b565cc6f408e..f89798da8a14 100644
@@ -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
index 7c3b3671d6c2..6d1337c169cd 100644
@@ -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
index 869a3ac6bf23..7ccc077a60be 100644
@@ -39,6 +39,7 @@ get_cycles (void)
 	ret = ia64_getreg(_IA64_REG_AR_ITC);
 	return ret;
 }
+#define get_cycles get_cycles
 
 extern void ia64_cpu_local_tick (void);
 extern unsigned long long ia64_native_sched_clock (void);
arch/m68k/include/asm/timex.h +1 -1
index 6a21d9358280..f4a7a340f4ca 100644
@@ -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
index 8026baf46e72..2e107886f97a 100644
@@ -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
index a769f871b28d..40a1adc9bd03 100644
@@ -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
index 06b510f8172e..b4622cb06a75 100644
@@ -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
index 95988870a57b..171602fd358e 100644
@@ -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
index 81de51e6aa32..a06697846e69 100644
@@ -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
index 289aaff4d365..588aa0f2c842 100644
@@ -172,6 +172,7 @@ static inline cycles_t get_cycles(void)
 {
 	return (cycles_t) get_tod_clock() >> 2;
 }
+#define get_cycles get_cycles
 
 int get_phys_clock(unsigned long *clock);
 void init_cpu_timer(void);
arch/sparc/include/asm/timex_32.h +1 -3
index 542915b46209..f86326a6f89e 100644
@@ -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
index e392a9a5bc9b..9f27176adb26 100644
@@ -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/crypto/Makefile +3 -1
index a31de0c6ccde..66f25c2938bf 100644
@@ -66,7 +66,9 @@ obj-$(CONFIG_CRYPTO_SHA512_SSSE3) += sha512-ssse3.o
 sha512-ssse3-y := sha512-ssse3-asm.o sha512-avx-asm.o sha512-avx2-asm.o sha512_ssse3_glue.o
 
 obj-$(CONFIG_CRYPTO_BLAKE2S_X86) += blake2s-x86_64.o
-blake2s-x86_64-y := blake2s-core.o blake2s-glue.o
+blake2s-x86_64-y := blake2s-shash.o
+obj-$(if $(CONFIG_CRYPTO_BLAKE2S_X86),y) += libblake2s-x86_64.o
+libblake2s-x86_64-y := blake2s-core.o blake2s-glue.o
 
 obj-$(CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL) += ghash-clmulni-intel.o
 ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o
arch/x86/crypto/blake2s-glue.c +6 -160

195 lines not on this page · raw message

arch/x86/crypto/blake2s-shash.c new file +77 -0

77 lines not on this page · raw message

arch/x86/include/asm/timex.h +9 -0
index a4a8b1b16c0c..956e4145311b 100644
@@ -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
index 01a300a9700b..fbdc3d951494 100644
@@ -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_cycles
 
 extern 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/kernel/cpu/mshyperv.c +1 -1
index 65d11711cd7b..021cd067733e 100644
@@ -84,7 +84,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_hyperv_stimer0)
 	inc_irq_stat(hyperv_stimer0_count);
 	if (hv_stimer0_handler)
 		hv_stimer0_handler();
-	add_interrupt_randomness(HYPERV_STIMER0_VECTOR, 0);
+	add_interrupt_randomness(HYPERV_STIMER0_VECTOR);
 	ack_APIC_irq();
 
 	set_irq_regs(old_regs);
arch/x86/kvm/lapic.c +6 -0
index a3ef793fce5f..6ed6b090be94 100644
@@ -297,6 +297,10 @@ static inline void apic_set_spiv(struct kvm_lapic *apic, u32 val)
 
 		atomic_set_release(&apic->vcpu->kvm->arch.apic_map_dirty, DIRTY);
 	}
+
+	/* Check if there are APF page ready requests pending */
+	if (enabled)
+		kvm_make_request(KVM_REQ_APF_READY, apic->vcpu);
 }
 
 static inline void kvm_apic_set_xapic_id(struct kvm_lapic *apic, u8 id)
@@ -2260,6 +2264,8 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value)
 		if (value & MSR_IA32_APICBASE_ENABLE) {
 			kvm_apic_set_xapic_id(apic, vcpu->vcpu_id);
 			static_key_slow_dec_deferred(&apic_hw_disabled);
+			/* Check if there are APF page ready requests pending */
+			kvm_make_request(KVM_REQ_APF_READY, vcpu);
 		} else {
 			static_key_slow_inc(&apic_hw_disabled.key);
 			atomic_set_release(&apic->vcpu->kvm->arch.apic_map_dirty, DIRTY);
arch/x86/kvm/mmu/mmu.c +4 -2
index 306268f90455..6096d0f1a62a 100644
@@ -5178,14 +5178,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/x86/kvm/x86.c +1 -1
index 4588f73bf59a..ae18062c26a6 100644
@@ -11146,7 +11146,7 @@ bool kvm_arch_can_dequeue_async_page_present(struct kvm_vcpu *vcpu)
 	if (!kvm_pv_async_pf_enabled(vcpu))
 		return true;
 	else
-		return apf_pageready_slot_free(vcpu);
+		return kvm_lapic_enabled(vcpu) && apf_pageready_slot_free(vcpu);
 }
 
 void kvm_arch_start_assignment(struct kvm *kvm)
arch/xtensa/include/asm/timex.h +2 -4
index 233ec75e60c6..3f2462f2d027 100644
@@ -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 */
crypto/Kconfig +2 -1
index 1157f82dc9cf..0dee9242491c 100644
@@ -1936,9 +1936,10 @@ config CRYPTO_STATS
 config CRYPTO_HASH_INFO
 	bool
 
-source "lib/crypto/Kconfig"
 source "drivers/crypto/Kconfig"
 source "crypto/asymmetric_keys/Kconfig"
 source "certs/Kconfig"
 
 endif	# if CRYPTO
+
+source "lib/crypto/Kconfig"
crypto/blake2s_generic.c +32 -126

181 lines not on this page · raw message

crypto/drbg.c +8 -9
index 3132967a1749..19ea8d6628ff 100644
@@ -1490,12 +1490,13 @@ static int drbg_generate_long(struct drbg_state *drbg,
 	return 0;
 }
 
-static void drbg_schedule_async_seed(struct random_ready_callback *rdy)
+static int drbg_schedule_async_seed(struct notifier_block *nb, unsigned long action, void *data)
 {
-	struct drbg_state *drbg = container_of(rdy, struct drbg_state,
+	struct drbg_state *drbg = container_of(nb, struct drbg_state,
 					       random_ready);
 
 	schedule_work(&drbg->seed_work);
+	return 0;
 }
 
 static int drbg_prepare_hrng(struct drbg_state *drbg)
@@ -1510,10 +1511,8 @@ static int drbg_prepare_hrng(struct drbg_state *drbg)
 
 	INIT_WORK(&drbg->seed_work, drbg_async_seed);
 
-	drbg->random_ready.owner = THIS_MODULE;
-	drbg->random_ready.func = drbg_schedule_async_seed;
-
-	err = add_random_ready_callback(&drbg->random_ready);
+	drbg->random_ready.notifier_call = drbg_schedule_async_seed;
+	err = register_random_ready_notifier(&drbg->random_ready);
 
 	switch (err) {
 	case 0:
@@ -1524,7 +1523,7 @@ static int drbg_prepare_hrng(struct drbg_state *drbg)
 		fallthrough;
 
 	default:
-		drbg->random_ready.func = NULL;
+		drbg->random_ready.notifier_call = NULL;
 		return err;
 	}
 
@@ -1628,8 +1627,8 @@ static int drbg_instantiate(struct drbg_state *drbg, struct drbg_string *pers,
  */
 static int drbg_uninstantiate(struct drbg_state *drbg)
 {
-	if (drbg->random_ready.func) {
-		del_random_ready_callback(&drbg->random_ready);
+	if (drbg->random_ready.notifier_call) {
+		unregister_random_ready_notifier(&drbg->random_ready);
 		cancel_work_sync(&drbg->seed_work);
 	}
 
drivers/acpi/sysfs.c +17 -6
index a5cc4f3bb1e3..1d94c4625f36 100644
@@ -439,18 +439,29 @@ static ssize_t acpi_data_show(struct file *filp, struct kobject *kobj,
 {
 	struct acpi_data_attr *data_attr;
 	void __iomem *base;
-	ssize_t rc;
+	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
index d229a2d0c017..3e2703a49632 100644
@@ -495,4 +495,5 @@ 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".
drivers/char/hw_random/core.c +1 -0
index 8c1c47dd9f46..5749998feaa4 100644
@@ -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 +1106 -1929

2,145 lines not on this page · raw message

drivers/hv/vmbus_drv.c +1 -1
index b9ac357e465d..5d820037e291 100644

Lines of this file are not shown. View the raw message.

drivers/media/test-drivers/vim2m.c +13 -9
index a776bb8e0e09..a24624353f9e 100644

Lines of this file are not shown. View the raw message.

drivers/net/Kconfig +0 -1
index cb865b7ec375..f20808024305 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireguard/noise.c +39 -6

45 lines not on this page · raw message

drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +4 -2
index 902ac8169948..083ff72976cf 100644

Lines of this file are not shown. View the raw message.

include/crypto/blake2s.h +32 -34

66 lines not on this page · raw message

include/crypto/chacha.h +11 -4
index dabaee698718..b3ea73b81944 100644

Lines of this file are not shown. View the raw message.

include/crypto/drbg.h +1 -1
index c4165126937e..88e4d145f7cd 100644

Lines of this file are not shown. View the raw message.

include/crypto/internal/blake2s.h +114 -9

123 lines not on this page · raw message

include/linux/cpuhotplug.h +2 -0
index 8fb893ed205e..fc945f9df2c1 100644

Lines of this file are not shown. View the raw message.

include/linux/hw_random.h +0 -2
index 8e6dd908da21..aa1d4da03538 100644

Lines of this file are not shown. View the raw message.

include/linux/mm.h +1 -0
index 289c26f055cd..5b4d88faf114 100644

Lines of this file are not shown. View the raw message.

include/linux/prandom.h +7 -16
index 056d31317e49..a4aadd2dc153 100644

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/linux/security.h +2 -0
index 35355429648e..330029ef7e89 100644

Lines of this file are not shown. View the raw message.

include/linux/siphash.h +28 -0
index 0cda61855d90..0bb5ecd507be 100644

Lines of this file are not shown. View the raw message.

include/linux/timex.h +9 -1
index ce0859763670..2efab9a806a9 100644

Lines of this file are not shown. View the raw message.

include/net/inet_hashtables.h +1 -1
index ca6a3ea9057e..d4d611064a76 100644

Lines of this file are not shown. View the raw message.

include/net/secure_seq.h +2 -2
index d7d2495f83c2..dac91aa38c5a 100644

Lines of this file are not shown. View the raw message.

include/trace/events/random.h deleted +0 -330

330 lines not on this page · raw message

init/main.c +5 -8
index 3526eaec7508..d8bfe61b5a88 100644

Lines of this file are not shown. View the raw message.

kernel/cpu.c +11 -0
index c06ced18f78a..3c9ee966c56a 100644

Lines of this file are not shown. View the raw message.

kernel/debug/debug_core.c +24 -0
index 8661eb2b1771..0f31b22abe8d 100644

Lines of this file are not shown. View the raw message.

kernel/debug/kdb/kdb_main.c +59 -3

62 lines not on this page · raw message

kernel/irq/handle.c +1 -1
index 762a928e18f9..8806444a6855 100644

Lines of this file are not shown. View the raw message.

kernel/time/timekeeping.c +15 -0
index cc4dc2857a87..e12ce2821dba 100644

Lines of this file are not shown. View the raw message.

lib/Kconfig.debug +1 -2
index 95f909540587..3656fa883783 100644

Lines of this file are not shown. View the raw message.

lib/crypto/Kconfig +6 -17
index 14c032de276e..af3da5a8bde8 100644

Lines of this file are not shown. View the raw message.

lib/crypto/Makefile +4 -5
index 3a435629d9ce..26be2bbe09c5 100644

Lines of this file are not shown. View the raw message.

lib/crypto/blake2s-generic.c +5 -1
index 04ff8df24513..75ccb3e633e6 100644

Lines of this file are not shown. View the raw message.

lib/crypto/blake2s-selftest.c +1 -32
index 79ef404a990d..409e4b728770 100644

Lines of this file are not shown. View the raw message.

lib/crypto/blake2s.c +2 -79

81 lines not on this page · raw message

lib/random32.c +9 -7
index 4d0e05e471d7..f0ab17c2244b 100644

Lines of this file are not shown. View the raw message.

lib/sha1.c +14 -81

95 lines not on this page · raw message

lib/siphash.c +10 -22
index 025f0cbf6d7a..b4055b1cc2f6 100644

Lines of this file are not shown. View the raw message.

lib/vsprintf.c +6 -4
index 8ade1a86d818..daf32a489dc0 100644

Lines of this file are not shown. View the raw message.

mm/util.c +32 -0
index 890472760790..ba9643de689e 100644

Lines of this file are not shown. View the raw message.

net/core/secure_seq.c +2 -2
index b8a33c841846..7131cd1fb2ad 100644

Lines of this file are not shown. View the raw message.

net/ipv4/inet_hashtables.c +22 -6
index 915b8e1bd9ef..44b524136f95 100644

Lines of this file are not shown. View the raw message.

net/ipv6/inet6_hashtables.c +2 -2
index 0a2e7f228391..40203255ed88 100644

Lines of this file are not shown. View the raw message.

security/security.c +2 -0
index d9d42d64f89f..360706cdabab 100644

Lines of this file are not shown. View the raw message.

sound/pci/ctxfi/ctatc.c +2 -0
index f8ac96cf38a4..06775519dab0 100644

Lines of this file are not shown. View the raw message.

sound/pci/ctxfi/cthardware.h +2 -1
index 9e6b83bd432d..b50d61a08e28 100644

Lines of this file are not shown. View the 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.