The source for the Linux kernel used in Windows Subsystem for Linux 2 (WSL2)
Перейти к файлу
Waiman Long 3f5ec3c335 locking/rwsem: Disable preemption in all down_read*() and up_read() code paths
[ Upstream commit 3f5245538a ]

Commit:

  91d2a812df ("locking/rwsem: Make handoff writer optimistically spin on owner")

... assumes that when the owner field is changed to NULL, the lock will
become free soon. But commit:

  48dfb5d256 ("locking/rwsem: Disable preemption while trying for rwsem lock")

... disabled preemption when acquiring rwsem for write.

However, preemption has not yet been disabled when acquiring a read lock
on a rwsem.  So a reader can add a RWSEM_READER_BIAS to count without
setting owner to signal a reader, got preempted out by a RT task which
then spins in the writer slowpath as owner remains NULL leading to live lock.

One easy way to fix this problem is to disable preemption at all the
down_read*() and up_read() code paths as implemented in this patch.

Fixes: 91d2a812df ("locking/rwsem: Make handoff writer optimistically spin on owner")
Reported-by: Mukesh Ojha <quic_mojha@quicinc.com>
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20230126003628.365092-3-longman@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-10 09:39:03 +01:00
Documentation Documentation/hw-vuln: Add documentation for Cross-Thread Return Predictions 2023-02-14 19:18:05 +01:00
LICENSES
arch arm64: dts: amlogic: meson-sm1-odroid-hc4: fix active fan thermal trip 2023-03-10 09:39:03 +01:00
block block, bfq: fix uaf for bfqq in bic_set_bfqq() 2023-02-09 11:26:36 +01:00
certs certs/blacklist_hashes.c: fix const confusion in certs blacklist 2022-06-22 14:22:01 +02:00
crypto crypto: tcrypt - Fix multibuffer skcipher speed test mem leak 2022-12-31 13:14:24 +01:00
drivers HID: asus: use spinlock to safely schedule workers 2023-03-10 09:38:57 +01:00
fs btrfs: send: limit number of clones and allocated memory size 2023-03-03 11:45:52 +01:00
include uaccess: Add speculation barrier to copy_from_user() 2023-02-25 12:06:44 +01:00
init kbuild: Add CONFIG_PAHOLE_VERSION 2023-02-25 12:06:45 +01:00
io_uring io_uring: ensure that io_init_req() passes in the right issue_flags 2023-03-03 15:14:08 +01:00
ipc ipc/sem: Fix dangling sem_array access in semtimedop race 2022-12-08 11:28:45 +01:00
kernel locking/rwsem: Disable preemption in all down_read*() and up_read() code paths 2023-03-10 09:39:03 +01:00
lib lib/Kconfig.debug: Allow BTF + DWARF5 with pahole 1.21+ 2023-02-25 12:06:46 +01:00
mm mm/filemap: fix page end in filemap_get_read_batch 2023-02-22 12:57:10 +01:00
net net: Remove WARN_ON_ONCE(sk->sk_forward_alloc) from sk_stream_kill_queues(). 2023-03-03 11:45:53 +01:00
samples samples: vfio-mdev: Fix missing pci_disable_device() in mdpy_fb_probe() 2022-12-31 13:14:31 +01:00
scripts scripts/tags.sh: fix incompatibility with PCRE2 2023-03-03 11:45:53 +01:00
security tomoyo: fix broken dependency on *.conf.default 2023-02-01 08:27:05 +01:00
sound ASoC: rt715-sdca: fix clock stop prepare timeout issue 2023-03-03 11:45:52 +01:00
tools selftest/lkdtm: Skip stack-entropy test if lkdtm is not available 2023-02-22 12:57:07 +01:00
usr usr/include/Makefile: add linux/nfc.h to the compile-test coverage 2022-02-01 17:27:15 +01:00
virt kvm: Add support for arch compat vm ioctls 2022-10-29 10:12:54 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap mailmap: add Andrej Shadura 2021-10-18 20:22:03 -10:00
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS kbuild: Add CONFIG_PAHOLE_VERSION 2023-02-25 12:06:45 +01:00
Makefile Linux 5.15.98 2023-03-03 15:14:09 +01:00
README

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.