linux/drivers
Linus Torvalds 268325bda5 Random number generator updates for Linux 6.2-rc1.
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEq5lC5tSkz8NBJiCnSfxwEqXeA64FAmOU+U8ACgkQSfxwEqXe
 A67NnQ//Y5DltmvibyPd7r1TFT2gUYv+Rx3sUV9ZE1NYptd/SWhhcL8c5FZ70Fuw
 bSKCa1uiWjOxosjXT1kGrWq3de7q7oUpAPSOGxgxzoaNURIt58N/ajItCX/4Au8I
 RlGAScHy5e5t41/26a498kB6qJ441fBEqCYKQpPLINMBAhe8TQ+NVp0rlpUwNHFX
 WrUGg4oKWxdBIW3HkDirQjJWDkkAiklRTifQh/Al4b6QDbOnRUGGCeckNOhixsvS
 waHWTld+Td8jRrA4b82tUb2uVZ2/b8dEvj/A8CuTv4yC0lywoyMgBWmJAGOC+UmT
 ZVNdGW02Jc2T+Iap8ZdsEmeLHNqbli4+IcbY5xNlov+tHJ2oz41H9TZoYKbudlr6
 /ReAUPSn7i50PhbQlEruj3eg+M2gjOeh8OF8UKwwRK8PghvyWQ1ScW0l3kUhPIhI
 PdIG6j4+D2mJc1FIj2rTVB+Bg933x6S+qx4zDxGlNp62AARUFYf6EgyD6aXFQVuX
 RxcKb6cjRuFkzFiKc8zkqg5edZH+IJcPNuIBmABqTGBOxbZWURXzIQvK/iULqZa4
 CdGAFIs6FuOh8pFHLI3R4YoHBopbHup/xKDEeAO9KZGyeVIuOSERDxxo5f/ITzcq
 APvT77DFOEuyvanr8RMqqh0yUjzcddXqw9+ieufsAyDwjD9DTuE=
 =QRhK
 -----END PGP SIGNATURE-----

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

Pull random number generator updates from Jason Donenfeld:

 - Replace prandom_u32_max() and various open-coded variants of it,
   there is now a new family of functions that uses fast rejection
   sampling to choose properly uniformly random numbers within an
   interval:

       get_random_u32_below(ceil) - [0, ceil)
       get_random_u32_above(floor) - (floor, U32_MAX]
       get_random_u32_inclusive(floor, ceil) - [floor, ceil]

   Coccinelle was used to convert all current users of
   prandom_u32_max(), as well as many open-coded patterns, resulting in
   improvements throughout the tree.

   I'll have a "late" 6.1-rc1 pull for you that removes the now unused
   prandom_u32_max() function, just in case any other trees add a new
   use case of it that needs to converted. According to linux-next,
   there may be two trivial cases of prandom_u32_max() reintroductions
   that are fixable with a 's/.../.../'. So I'll have for you a final
   conversion patch doing that alongside the removal patch during the
   second week.

   This is a treewide change that touches many files throughout.

 - More consistent use of get_random_canary().

 - Updates to comments, documentation, tests, headers, and
   simplification in configuration.

 - The arch_get_random*_early() abstraction was only used by arm64 and
   wasn't entirely useful, so this has been replaced by code that works
   in all relevant contexts.

 - The kernel will use and manage random seeds in non-volatile EFI
   variables, refreshing a variable with a fresh seed when the RNG is
   initialized. The RNG GUID namespace is then hidden from efivarfs to
   prevent accidental leakage.

   These changes are split into random.c infrastructure code used in the
   EFI subsystem, in this pull request, and related support inside of
   EFISTUB, in Ard's EFI tree. These are co-dependent for full
   functionality, but the order of merging doesn't matter.

 - Part of the infrastructure added for the EFI support is also used for
   an improvement to the way vsprintf initializes its siphash key,
   replacing an sleep loop wart.

 - The hardware RNG framework now always calls its correct random.c
   input function, add_hwgenerator_randomness(), rather than sometimes
   going through helpers better suited for other cases.

 - The add_latent_entropy() function has long been called from the fork
   handler, but is a no-op when the latent entropy gcc plugin isn't
   used, which is fine for the purposes of latent entropy.

   But it was missing out on the cycle counter that was also being mixed
   in beside the latent entropy variable. So now, if the latent entropy
   gcc plugin isn't enabled, add_latent_entropy() will expand to a call
   to add_device_randomness(NULL, 0), which adds a cycle counter,
   without the absent latent entropy variable.

 - The RNG is now reseeded from a delayed worker, rather than on demand
   when used. Always running from a worker allows it to make use of the
   CPU RNG on platforms like S390x, whose instructions are too slow to
   do so from interrupts. It also has the effect of adding in new inputs
   more frequently with more regularity, amounting to a long term
   transcript of random values. Plus, it helps a bit with the upcoming
   vDSO implementation (which isn't yet ready for 6.2).

 - The jitter entropy algorithm now tries to execute on many different
   CPUs, round-robining, in hopes of hitting even more memory latencies
   and other unpredictable effects. It also will mix in a cycle counter
   when the entropy timer fires, in addition to being mixed in from the
   main loop, to account more explicitly for fluctuations in that timer
   firing. And the state it touches is now kept within the same cache
   line, so that it's assured that the different execution contexts will
   cause latencies.

* tag 'random-6.2-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random: (23 commits)
  random: include <linux/once.h> in the right header
  random: align entropy_timer_state to cache line
  random: mix in cycle counter when jitter timer fires
  random: spread out jitter callback to different CPUs
  random: remove extraneous period and add a missing one in comments
  efi: random: refresh non-volatile random seed when RNG is initialized
  vsprintf: initialize siphash key using notifier
  random: add back async readiness notifier
  random: reseed in delayed work rather than on-demand
  random: always mix cycle counter in add_latent_entropy()
  hw_random: use add_hwgenerator_randomness() for early entropy
  random: modernize documentation comment on get_random_bytes()
  random: adjust comment to account for removed function
  random: remove early archrandom abstraction
  random: use random.trust_{bootloader,cpu} command line option only
  stackprotector: actually use get_random_canary()
  stackprotector: move get_random_canary() into stackprotector.h
  treewide: use get_random_u32_inclusive() when possible
  treewide: use get_random_u32_{above,below}() instead of manual loop
  treewide: use get_random_u32_below() instead of deprecated function
  ...
2022-12-12 16:22:22 -08:00
..
accessibility speakup: replace utils' u_char with unsigned char 2022-11-09 15:25:24 +01:00
acpi - Make ghes_edac a simple module like the rest of the EDAC drivers and 2022-12-12 14:47:31 -08:00
amba
android binder: validate alloc->mm in ->mmap() handler 2022-11-09 15:41:27 +01:00
ata ata: libahci_platform: ahci_platform_find_clk: oops, NULL pointer 2022-12-07 08:36:37 +09:00
atm
auxdisplay
base Power management updates for 6.2-rc1 2022-12-12 13:19:07 -08:00
bcma Interrupt subsystem updates: 2022-10-12 10:23:24 -07:00
block Random number generator updates for Linux 6.2-rc1. 2022-12-12 16:22:22 -08:00
bluetooth Updates for timers, timekeeping and drivers: 2022-12-12 12:52:02 -08:00
bus Random number generator updates for Linux 6.2-rc1. 2022-12-12 16:22:22 -08:00
cdrom
char Random number generator updates for Linux 6.2-rc1. 2022-12-12 16:22:22 -08:00
clk SoC driver updates for 6.2 2022-12-12 10:17:08 -08:00
clocksource Updates for timers, timekeeping and drivers: 2022-12-12 12:52:02 -08:00
comedi
connector
counter counter: 104-quad-8: Fix race getting function mode and direction 2022-10-23 20:39:26 -04:00
cpufreq cpufreq: stats: Convert to use sysfs_emit_at() API 2022-12-06 12:20:07 +01:00
cpuidle cpuidle: dt: Clarify a comment and simplify code in dt_init_idle_driver() 2022-10-28 20:07:28 +02:00
crypto This update includes the following changes: 2022-10-10 13:04:25 -07:00
cxl cxl/region: Fix memdev reuse check 2022-12-08 13:03:47 -08:00
dax device-dax: Fix duplicate 'hmem' device registration 2022-11-21 15:34:40 -08:00
dca
devfreq PM / devfreq: event: use devm_platform_get_and_ioremap_resource() 2022-12-05 21:57:20 +09:00
dio
dma genirq: Get rid of GENERIC_MSI_IRQ_DOMAIN 2022-11-17 15:15:20 +01:00
dma-buf Random number generator updates for Linux 6.2-rc1. 2022-12-12 16:22:22 -08:00
edac Merge branches 'edac-ghes' and 'edac-misc' into edac-updates-for-v6.2 2022-12-12 15:40:03 +01:00
eisa
extcon extcon: usbc-tusb320: Call the Type-C IRQ handler only if a port is registered 2022-11-08 16:45:31 +01:00
firewire
firmware Random number generator updates for Linux 6.2-rc1. 2022-12-12 16:22:22 -08:00
fpga fpga: m10bmc-sec: Fix kconfig dependencies 2022-11-15 21:46:58 +08:00
fsi fsi: core: Check error number after calling ida_simple_get 2022-09-28 21:10:57 +09:30
gnss
gpio gpio/rockchip: fix refcount leak in rockchip_gpiolib_register() 2022-12-06 10:10:46 +01:00
gpu Random number generator updates for Linux 6.2-rc1. 2022-12-12 16:22:22 -08:00
greybus
hid for-linus-2022120801 2022-12-08 12:37:42 -08:00
hsi
hte
hv ACPI updates for 6.2-rc1 2022-12-12 13:38:17 -08:00
hwmon Merge branches 'acpi-scan', 'acpi-bus', 'acpi-tables' and 'acpi-sysfs' 2022-12-12 14:55:44 +01:00
hwspinlock
hwtracing coresight: cti: Fix hang in cti_disable_hw() 2022-10-25 19:08:07 +02:00
i2c i2c: imx: Only DMA messages with I2C_M_DMA_SAFE flag set 2022-12-02 00:12:25 +01:00
i3c i3c: master: Remove the wrong place of reattach. 2022-10-12 23:45:29 +02:00
idle
iio iio: adc: aspeed: Remove the trim valid dts property. 2022-11-14 20:20:08 +00:00
infiniband treewide: use get_random_u32_inclusive() when possible 2022-11-18 02:18:02 +01:00
input Merge branches 'acpi-scan', 'acpi-bus', 'acpi-tables' and 'acpi-sysfs' 2022-12-12 14:55:44 +01:00
interconnect
iommu Updates for the interrupt core and driver subsystem: 2022-12-12 11:21:29 -08:00
ipack Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
irqchip irqchip updates for 6.2 2022-12-07 17:50:44 +01:00
isdn mISDN: fix misuse of put_device() in mISDN_register_device() 2022-11-14 10:43:13 +00:00
leds leds: simatic-ipc-leds-gpio: fix incorrect LED to GPIO mapping 2022-10-24 11:32:10 +02:00
macintosh powerpc updates for 6.1 2022-10-09 14:05:15 -07:00
mailbox ACPI updates for 6.2-rc1 2022-12-12 13:38:17 -08:00
mcb
md Random number generator updates for Linux 6.2-rc1. 2022-12-12 16:22:22 -08:00
media Random number generator updates for Linux 6.2-rc1. 2022-12-12 16:22:22 -08:00
memory memory: tegra: Changes for v6.2-rc1 2022-11-22 22:38:02 +01:00
memstick
message
mfd Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()" 2022-10-23 12:04:56 -07:00
misc misc/vmw_vmci: fix an infoleak in vmci_host_do_receive_datagram() 2022-11-09 15:40:03 +01:00
mmc Random number generator updates for Linux 6.2-rc1. 2022-12-12 16:22:22 -08:00
most
mtd Random number generator updates for Linux 6.2-rc1. 2022-12-12 16:22:22 -08:00
mux
net Random number generator updates for Linux 6.2-rc1. 2022-12-12 16:22:22 -08:00
nfc nfc: st-nci: fix incorrect sizing calculations in EVT_TRANSACTION 2022-11-23 20:01:50 -08:00
ntb
nubus
nvdimm nvdimm/region: Move cache management to the region driver 2022-12-02 23:52:32 -08:00
nvme block-6.1-2022-12-08 2022-12-08 15:53:39 -08:00
nvmem SoC driver updates for 6.2 2022-12-12 10:17:08 -08:00
of SoC: DT changes for 6.2 2022-12-12 10:21:03 -08:00
opp OPP: decouple dt properties in opp_parse_supplies() 2022-11-04 10:59:07 +05:30
parisc parisc: Export iosapic_serial_irq() symbol for serial port driver 2022-10-27 09:12:05 +02:00
parport parport_pc: Avoid FIFO port location truncation 2022-11-09 15:40:32 +01:00
pci Random number generator updates for Linux 6.2-rc1. 2022-12-12 16:22:22 -08:00
pcmcia pcmcia: remove AT91RM9200 Compact Flash driver 2022-09-27 08:12:16 +02:00
peci
perf Perf events updates for v6.2: 2022-12-12 15:19:38 -08:00
phy phy: ralink: mt7621-pci: add sentinel to quirks table 2022-11-05 13:01:25 +05:30
pinctrl pinctrl: intel: Save and restore pins in "direct IRQ" mode 2022-11-28 21:41:31 +01:00
platform ACPI updates for 6.2-rc1 2022-12-12 13:38:17 -08:00
pnp PNP: Do not disable devices on suspend when they cannot be re-enabled on resume 2022-11-25 19:36:52 +01:00
power power: supply: ab8500: Defer thermal zone probe 2022-11-01 01:00:32 +01:00
powercap powercap: idle_inject: Fix warnings with make W=1 2022-12-02 20:49:49 +01:00
pps
ps3
ptp ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
pwm pwm: Changes for v6.1-rc1 2022-10-07 11:32:10 -07:00
rapidio
ras RAS: Fix return value from show_trace() 2022-10-31 18:55:18 +01:00
regulator regulator: Late fixes for v6.1 2022-11-25 13:54:48 -08:00
remoteproc remoteproc: virtio: Fix warning on bindings by removing the of_match_table 2022-10-05 09:20:44 -06:00
reset Here's the main clk pull request for this merge window. We have some 2022-10-08 10:06:48 -07:00
rpmsg
rtc rtc: cmos: fix build on non-ACPI platforms 2022-10-18 22:36:54 +02:00
s390 Random number generator updates for Linux 6.2-rc1. 2022-12-12 16:22:22 -08:00
sbus sparc: sbus: treat CPU index as integer 2022-11-19 00:56:15 +01:00
scsi Random number generator updates for Linux 6.2-rc1. 2022-12-12 16:22:22 -08:00
sh
siox siox: fix possible memory leak in siox_device_add() 2022-11-09 15:40:14 +01:00
slimbus slimbus: qcom-ngd: Fix build error when CONFIG_SLIM_QCOM_NGD_CTRL=y && CONFIG_QCOM_RPROC_COMMON=m 2022-11-10 18:45:40 +01:00
soc Updates for the interrupt core and driver subsystem: 2022-12-12 11:21:29 -08:00
soundwire soundwire: qcom: check for outanding writes before doing a read 2022-10-28 17:00:38 +05:30
spi spi: Fixes for v6.1 2022-11-23 11:19:06 -08:00
spmi spmi: pmic-arb: increase SPMI transaction timeout delay 2022-09-30 14:33:23 +02:00
ssb
staging Updates for timers, timekeeping and drivers: 2022-12-12 12:52:02 -08:00
target scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus() 2022-11-17 17:46:16 +00:00
tc
tee SoC driver updates for 6.2 2022-12-12 10:17:08 -08:00
thermal Thermal control updates for 6.2-rc1 2022-12-12 13:45:21 -08:00
thunderbolt treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
tty printk changes for 6.2 2022-12-12 09:01:36 -08:00
ufs scsi: ufs: core: Fix typo in comment 2022-10-22 03:29:32 +00:00
uio
usb SoC driver updates for 6.2 2022-12-12 10:17:08 -08:00
vdpa virtio: fixes, features 2022-10-10 14:02:53 -07:00
vfio Updates for the interrupt core and driver subsystem: 2022-12-12 11:21:29 -08:00
vhost virtio: fixes, features 2022-10-10 14:02:53 -07:00
video ACPI updates for 6.2-rc1 2022-12-12 13:38:17 -08:00
virt Add TDX guest attestation infrastructure and driver 2022-12-12 14:27:49 -08:00
virtio virtio_pci: use irq to detect interrupt support 2022-10-13 09:33:03 -04:00
vlynq
w1 Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
watchdog ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
xen ACPI updates for 6.2-rc1 2022-12-12 13:38:17 -08:00
zorro
Kconfig
Makefile