Go to file
Marco Elver 7e8cad8788 kcsan: Rewrite kcsan_prandom_u32_max() without prandom_u32_state()
[ Upstream commit 71a076f4a61a6c779794ad286f356b39725edc3b ]

Rewrite kcsan_prandom_u32_max() to not depend on code that might be
instrumented, removing any dependency on lib/random32.c. The rewrite
implements a simple linear congruential generator, that is sufficient
for our purposes (for udelay() and skip_watch counter randomness).

The initial motivation for this was to allow enabling KCSAN for
kernel/sched (remove KCSAN_SANITIZE := n from kernel/sched/Makefile),
with CONFIG_DEBUG_PREEMPT=y. Without this change, we could observe
recursion:

	check_access() [via instrumentation]
	  kcsan_setup_watchpoint()
	    reset_kcsan_skip()
	      kcsan_prandom_u32_max()
	        get_cpu_var()
		  preempt_disable()
		    preempt_count_add() [in kernel/sched/core.c]
		      check_access() [via instrumentation]

Note, while this currently does not affect an unmodified kernel, it'd be
good to keep a KCSAN kernel working when KCSAN_SANITIZE := n is removed
from kernel/sched/Makefile to permit testing scheduler code with KCSAN
if desired.

Fixes: cd290ec246 ("kcsan: Use tracing-safe version of prandom")
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-04 11:37:37 +01:00
arch crypto: arm64/aes-ce - really hide slower algos when faster ones are enabled 2021-03-04 11:37:37 +01:00
block bfq: Avoid false bfq queue merging 2021-03-04 11:37:18 +01:00
certs
crypto
Documentation scsi: libsas: docs: Remove notify_ha_event() 2021-03-04 11:37:17 +01:00
drivers media: allegro: Fix use after free on error 2021-03-04 11:37:37 +01:00
fs debugfs: do not attempt to create a new file before the filesystem is initalized 2021-03-04 11:37:17 +01:00
include tty: convert tty_ldisc_ops 'read()' function to take a kernel pointer 2021-03-04 11:37:36 +01:00
init
ipc
kernel kcsan: Rewrite kcsan_prandom_u32_max() without prandom_u32_state() 2021-03-04 11:37:37 +01:00
lib
LICENSES
mm mm: provide a saner PTE walking API for modules 2021-02-26 10:13:01 +01:00
net tty: convert tty_ldisc_ops 'read()' function to take a kernel pointer 2021-03-04 11:37:36 +01:00
samples
scripts scripts/recordmcount.pl: support big endian for ARCH sh 2021-02-26 10:13:02 +01:00
security
sound ALSA: pcm: Don't call sync_stop if it hasn't been stopped 2021-03-04 11:37:19 +01:00
tools selftests: mptcp: fix ACKRX debug message 2021-03-04 11:37:33 +01:00
usr
virt KVM: Use kvm_pfn_t for local PFN variable in hva_to_pfn_remapped() 2021-02-26 10:13:01 +01:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile Linux 5.10.19 2021-02-26 10:14:35 +01:00
README

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.