Go to file
Eric Biggers 3de9478230 random: fix data race on crng_node_pool
commit 5d73d1e320 upstream.

extract_crng() and crng_backtrack_protect() load crng_node_pool with a
plain load, which causes undefined behavior if do_numa_crng_init()
modifies it concurrently.

Fix this by using READ_ONCE().  Note: as per the previous discussion
https://lore.kernel.org/lkml/20211219025139.31085-1-ebiggers@kernel.org/T/#u,
READ_ONCE() is believed to be sufficient here, and it was requested that
it be used here instead of smp_load_acquire().

Also change do_numa_crng_init() to set crng_node_pool using
cmpxchg_release() instead of mb() + cmpxchg(), as the former is
sufficient here but is more lightweight.

Fixes: 1e7f583af6 ("random: make /dev/urandom scalable for silly userspace programs")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-16 09:14:23 +01:00
arch ARM: dts: exynos: Fix BCM4330 Bluetooth reset polarity in I9100 2022-01-16 09:14:22 +01:00
block iocost: Fix divide-by-zero on donation from low hweight cgroup 2021-12-22 09:30:57 +01:00
certs certs: Trigger creation of RSA module signing key if it's not an RSA key 2021-09-15 09:50:29 +02:00
crypto crypto: pcrypt - Delay write to padata->info 2021-11-18 14:04:12 +01:00
Documentation bpf: Add kconfig knob for disabling unpriv bpf by default 2022-01-05 12:40:34 +01:00
drivers random: fix data race on crng_node_pool 2022-01-16 09:14:23 +01:00
fs xfs: map unwritten blocks in XFS_IOC_{ALLOC,FREE}SP just like fallocate 2022-01-11 15:25:01 +01:00
include uapi: fix linux/nfc.h userspace compilation errors 2022-01-05 12:40:32 +01:00
init bpf: Add kconfig knob for disabling unpriv bpf by default 2022-01-05 12:40:34 +01:00
ipc shm: extend forced shm destroy to support objects from several IPC nses 2021-12-01 09:19:10 +01:00
kernel bpf: Fix out of bounds access from invalid *_or_null type verification 2022-01-16 09:14:22 +01:00
lib siphash: use _unaligned version by default 2021-12-08 09:03:23 +01:00
LICENSES LICENSES/deprecated: add Zlib license text 2020-09-16 14:33:49 +02:00
mm mm: mempolicy: fix THP allocations escaping mempolicy restrictions 2021-12-29 12:26:06 +01:00
net can: isotp: convert struct tpcon::{idx,len} to unsigned int 2022-01-16 09:14:23 +01:00
samples ftrace/samples: Add missing prototypes direct functions 2022-01-11 15:25:00 +01:00
scripts recordmcount.pl: fix typo in s390 mcount regex 2022-01-05 12:40:29 +01:00
security selinux: initialize proto variable in selinux_ip_postroute_compat() 2022-01-05 12:40:30 +01:00
sound ASoC: rt5682: fix the wrong jack type detected 2021-12-29 12:26:07 +01:00
tools selftests: x86: fix [-Wstringop-overread] warn in test_process_vm_readv() 2022-01-11 15:24:58 +01:00
usr Merge branch 'work.fdpic' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-08-07 13:29:39 -07:00
virt KVM: downgrade two BUG_ONs to WARN_ON_ONCE 2021-12-22 09:30:50 +01:00
.clang-format RDMA 5.10 pull request 2020-10-17 11:18:18 -07:00
.cocciconfig
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl 2019-05-16 10:53:40 -07:00
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore kbuild: generate Module.symvers only when vmlinux exists 2021-05-19 10:12:59 +02:00
.mailmap mailmap: add two more addresses of Uwe Kleine-König 2020-12-06 10:19:07 -08:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: Move Jason Cooper to CREDITS 2020-11-30 10:20:34 +01:00
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y 2020-02-04 01:53:07 +09:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS MAINTAINERS: adjust GCC PLUGINS after gcc-plugin.sh removal 2021-12-14 11:32:46 +01:00
Makefile Linux 5.10.91 2022-01-11 15:25:03 +01:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.