Skip to contentSkip to conversation

Linux 5.15.44

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.15.44 kernel.

All users of the 5.15 kernel series must upgrade.

The updated 5.15.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.15.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/crypto/Makefile                        |    4 
 arch/arm/crypto/blake2s-core.S                  |    8 
 arch/arm/crypto/blake2s-glue.c                  |   73 
 arch/arm/crypto/blake2s-shash.c                 |   75 
 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                  |   68 
 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/mmu/mmu.c                          |    6 
 arch/xtensa/include/asm/timex.h                 |    6 
 crypto/Kconfig                                  |    3 
 crypto/blake2s_generic.c                        |    4 
 crypto/drbg.c                                   |   17 
 drivers/acpi/sysfs.c                            |   25 
 drivers/char/Kconfig                            |    3 
 drivers/char/hw_random/core.c                   |    1 
 drivers/char/random.c                           | 3011 ++++++++----------------
 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 
 drivers/hv/vmbus_drv.c                          |    2 
 drivers/net/Kconfig                             |    1 
 drivers/net/ethernet/intel/ice/ice_xsk.c        |    2 
 drivers/net/wireguard/noise.c                   |   45 
 include/crypto/blake2s.h                        |    3 
 include/crypto/chacha.h                         |   15 
 include/crypto/drbg.h                           |    2 
 include/crypto/internal/blake2s.h               |   46 
 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                   |  247 -
 init/main.c                                     |   13 
 kernel/cpu.c                                    |   11 
 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                   |   31 
 lib/crypto/blake2s.c                            |   47 
 lib/random32.c                                  |   16 
 lib/sha1.c                                      |   95 
 lib/siphash.c                                   |   32 
 lib/vsprintf.c                                  |   10 
 mm/util.c                                       |   32 
 sound/pci/ctxfi/ctatc.c                         |    2 
 sound/pci/ctxfi/cthardware.h                    |    3 
 71 files changed, 1682 insertions(+), 2699 deletions(-)

Basavaraj Natikar (1):
HID: amd_sfh: Add support for sensor discovery

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 (1):
random: remove use_input_pool parameter from crng_reseed()

Greg Kroah-Hartman (1):

      Linux 5.15.44

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

Magnus Karlsson (1):
ice: fix crash at allocation failure

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

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

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

author maintainer
#1 lore raw
Documentation/admin-guide/kernel-parameters.txt +6 -0
index bb25aae69860..fd3d14dabadc 100644
@@ -4307,6 +4307,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
index d6977875c1b7..609b89175408 100644
@@ -1014,28 +1014,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 c8103e57a70b..942e0b173f2c 100644
@@ -15720,6 +15720,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 6192e6be49c3..b8ce2ba17486 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 VERSION = 5
 PATCHLEVEL = 15
-SUBLEVEL = 43
+SUBLEVEL = 44
 EXTRAVERSION =
 NAME = Trick or Treat
 
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/crypto/Makefile +3 -1
index eafa898ba6a7..0274f81cc8ea 100644
@@ -10,6 +10,7 @@ obj-$(CONFIG_CRYPTO_SHA1_ARM_NEON) += sha1-arm-neon.o
 obj-$(CONFIG_CRYPTO_SHA256_ARM) += sha256-arm.o
 obj-$(CONFIG_CRYPTO_SHA512_ARM) += sha512-arm.o
 obj-$(CONFIG_CRYPTO_BLAKE2S_ARM) += blake2s-arm.o
+obj-$(if $(CONFIG_CRYPTO_BLAKE2S_ARM),y) += libblake2s-arm.o
 obj-$(CONFIG_CRYPTO_BLAKE2B_NEON) += blake2b-neon.o
 obj-$(CONFIG_CRYPTO_CHACHA20_NEON) += chacha-neon.o
 obj-$(CONFIG_CRYPTO_POLY1305_ARM) += poly1305-arm.o
@@ -31,7 +32,8 @@ sha256-arm-neon-$(CONFIG_KERNEL_MODE_NEON) := sha256_neon_glue.o
 sha256-arm-y	:= sha256-core.o sha256_glue.o $(sha256-arm-neon-y)
 sha512-arm-neon-$(CONFIG_KERNEL_MODE_NEON) := sha512-neon-glue.o
 sha512-arm-y	:= sha512-core.o sha512-glue.o $(sha512-arm-neon-y)
-blake2s-arm-y   := blake2s-core.o blake2s-glue.o
+blake2s-arm-y   := blake2s-shash.o
+libblake2s-arm-y:= blake2s-core.o blake2s-glue.o
 blake2b-neon-y  := blake2b-neon-core.o blake2b-neon-glue.o
 sha1-arm-ce-y	:= sha1-ce-core.o sha1-ce-glue.o
 sha2-arm-ce-y	:= sha2-ce-core.o sha2-ce-glue.o
arch/arm/crypto/blake2s-core.S +4 -4
index 86345751bbf3..df40e46601f1 100644
@@ -167,8 +167,8 @@
 .endm
 
 //
-// void blake2s_compress_arch(struct blake2s_state *state,
-//			      const u8 *block, size_t nblocks, u32 inc);
+// void blake2s_compress(struct blake2s_state *state,
+//			 const u8 *block, size_t nblocks, u32 inc);
 //
 // Only the first three fields of struct blake2s_state are used:
 //	u32 h[8];	(inout)
@@ -176,7 +176,7 @@
 //	u32 f[2];	(in)
 //
 	.align		5
-ENTRY(blake2s_compress_arch)
+ENTRY(blake2s_compress)
 	push		{r0-r2,r4-r11,lr}	// keep this an even number
 
 .Lnext_block:
@@ -303,4 +303,4 @@ ENTRY(blake2s_compress_arch)
 	str		r3, [r12], #4
 	bne		1b
 	b		.Lcopy_block_done
-ENDPROC(blake2s_compress_arch)
+ENDPROC(blake2s_compress)
arch/arm/crypto/blake2s-glue.c +1 -72

79 lines not on this page · raw message

arch/arm/crypto/blake2s-shash.c new file +75 -0

75 lines not on this page · raw message

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 fa2e76e4093a..14b4489de52c 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 507cae273bc6..d6a7428f6248 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 50d9b04ecbd1..bc50ee0e91ff 100644
@@ -201,6 +201,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 f307c93fc90a..c3af959648e6 100644
@@ -62,7 +62,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 -62

97 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 ef6316fef99f..ba0efc30fac5 100644
@@ -79,7 +79,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/mmu/mmu.c +4 -2
index c5fd00945e75..3417405077ad 100644
@@ -5396,14 +5396,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
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 285f82647d2b..55718de56137 100644
@@ -1919,9 +1919,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 +2 -2
index 72fe480f9bd6..5f96a21f8788 100644
@@ -15,12 +15,12 @@
 static int crypto_blake2s_update_generic(struct shash_desc *desc,
 					 const u8 *in, unsigned int inlen)
 {
-	return crypto_blake2s_update(desc, in, inlen, blake2s_compress_generic);
+	return crypto_blake2s_update(desc, in, inlen, true);
 }
 
 static int crypto_blake2s_final_generic(struct shash_desc *desc, u8 *out)
 {
-	return crypto_blake2s_final(desc, out, blake2s_compress_generic);
+	return crypto_blake2s_final(desc, out, true);
 }
 
 #define BLAKE2S_ALG(name, driver_name, digest_size)			\
crypto/drbg.c +8 -9
index ea85d4a0fe9e..03c9ef768c22 100644
@@ -1491,12 +1491,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)
@@ -1511,10 +1512,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:
@@ -1525,7 +1524,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;
 	}
 
@@ -1629,8 +1628,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 +18 -7
index 00c0ebaab29f..6e23b76aef5d 100644
@@ -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
index 740811893c57..55f48375e3fe 100644
@@ -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
index a3db27916256..cfb085de876b 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 -1905

2,239 lines not on this page · raw message

drivers/hid/amd-sfh-hid/amd_sfh_client.c +11 -0
index 840fd075c56f..6284db50ec9b 100644

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

drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +7 -0
index 561bb27f42b1..ae8f1f2536e9 100644

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

drivers/hid/amd-sfh-hid/amd_sfh_pcie.h +4 -0
index 00fc083dc123..2d3203d3daeb 100644

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

drivers/hv/vmbus_drv.c +1 -1
index aea8125a4db8..50d9113f5402 100644

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

drivers/net/Kconfig +0 -1
index dd335ae1122b..44a7d36446c5 100644

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

drivers/net/ethernet/intel/ice/ice_xsk.c +1 -1
index 2b1873061912..5581747947e5 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

include/crypto/blake2s.h +0 -3
index bc3fb59442ce..4e30e1799e61 100644

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

46 lines not on this page · raw message

include/linux/cpuhotplug.h +2 -0
index 991911048857..c88ccc48877d 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 04345ff97f8c..85205adcdd0d 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/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 059b18eb1f1f..3871b06bd302 100644

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

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

247 lines not on this page · raw message

init/main.c +5 -8
index 06b98350ebd2..cf79b5a766cb 100644

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

kernel/cpu.c +11 -0
index 5601216eb51b..da871eb07566 100644

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

kernel/irq/handle.c +1 -1
index 221d80c31e94..fca637d4da1a 100644

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

kernel/time/timekeeping.c +15 -0
index 3b1398fbddaf..871c912860ed 100644

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

lib/Kconfig.debug +1 -2
index 55e89b237b6f..7fd3fa05379e 100644

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

lib/crypto/Kconfig +6 -17
index 545ccbddf6a1..8620f38e117c 100644

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

lib/crypto/Makefile +4 -5
index 73205ed269ba..ed43a41f2dcc 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 +0 -31
index 5d9ea53be973..409e4b728770 100644

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

lib/crypto/blake2s.c +2 -45

47 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 72b9068ab57b..71d315a6ad62 100644

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

lib/vsprintf.c +6 -4
index a3b73f28b7a9..a60f0bb2ea90 100644

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

mm/util.c +32 -0
index ea09dd33ab59..3073de05c2bd 100644

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

sound/pci/ctxfi/ctatc.c +2 -0
index 78f35e88aed6..fbdb8a3d5b8e 100644

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

sound/pci/ctxfi/cthardware.h +2 -1
index f406b626a28c..2875cec83b8f 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.