No description
Find a file
Marco Elver e0e5c5ea30 perf: Fix data race between pin_count increment/decrement
commit 6c605f8371 upstream.

KCSAN reports a data race between increment and decrement of pin_count:

  write to 0xffff888237c2d4e0 of 4 bytes by task 15740 on cpu 1:
   find_get_context		kernel/events/core.c:4617
   __do_sys_perf_event_open	kernel/events/core.c:12097 [inline]
   __se_sys_perf_event_open	kernel/events/core.c:11933
   ...
  read to 0xffff888237c2d4e0 of 4 bytes by task 15743 on cpu 0:
   perf_unpin_context		kernel/events/core.c:1525 [inline]
   __do_sys_perf_event_open	kernel/events/core.c:12328 [inline]
   __se_sys_perf_event_open	kernel/events/core.c:11933
   ...

Because neither read-modify-write here is atomic, this can lead to one
of the operations being lost, resulting in an inconsistent pin_count.
Fix it by adding the missing locking in the CPU-event case.

Fixes: fe4b04fa31 ("perf: Cure task_oncpu_function_call() races")
Reported-by: syzbot+142c9018f5962db69c7e@syzkaller.appspotmail.com
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210527104711.2671610-1-elver@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-16 11:53:04 +02:00
arch powerpc/fsl: set fsl,i2c-erratum-a004447 flag for P1010 i2c controllers 2021-06-16 11:53:02 +02:00
block blk-mq: Swap two calls in blk_mq_exit_queue() 2021-05-22 10:57:40 +02:00
certs certs: Fix blacklist flag type confusion 2021-03-03 18:22:46 +01:00
crypto crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-22 10:57:16 +02:00
Documentation tweewide: Fix most Shebang lines 2021-06-03 08:36:11 +02:00
drivers regulator: max77620: Use device_set_of_node_from_dev() 2021-06-16 11:53:04 +02:00
firmware Fix built-in early-load Intel microcode alignment 2020-01-23 08:20:30 +01:00
fs btrfs: return value from btrfs_mark_extent_written() in case of error 2021-06-16 11:53:02 +02:00
include kvm: avoid speculation-based attacks from out-of-range memslot accesses 2021-06-16 11:53:02 +02:00
init pid: take a reference when initializing cad_pid 2021-06-10 12:43:51 +02:00
ipc ipc/util.c: sysvipc_find_ipc() incorrectly updates position index 2020-05-20 08:17:07 +02:00
kernel perf: Fix data race between pin_count increment/decrement 2021-06-16 11:53:04 +02:00
lib lib: stackdepot: turn depot_lock spinlock to raw_spinlock 2021-05-22 10:57:43 +02:00
mm mm, hugetlb: fix simple resv_huge_pages underflow on UFFDIO_COPY 2021-06-10 12:43:51 +02:00
net netlink: disable IRQs for netlink_lock_table() 2021-06-16 11:53:01 +02:00
samples samples/bpf: Fix broken tracex1 due to kprobe argument change 2021-05-22 10:57:37 +02:00
scripts scripts: switch explicitly to Python 3 2021-06-03 08:36:11 +02:00
security security: commoncap: fix -Wstringop-overread warning 2021-05-22 10:57:21 +02:00
sound ASoC: sti-sas: add missing MODULE_DEVICE_TABLE 2021-06-16 11:53:00 +02:00
tools selftests/bpf: make 'dubious pointer arithmetic' test useful 2021-06-10 12:43:53 +02:00
usr initramfs: restore default compression behavior 2020-04-13 10:34:19 +02:00
virt KVM: arm64: Fix exclusive limit for IPA size 2021-03-17 16:34:35 +01:00
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS MAINTAINERS: Update drm/i915 bug filing URL 2020-02-28 16:36:12 +01:00
Makefile Linux 4.14.236 2021-06-10 12:43:54 +02:00
README

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

This file was moved to Documentation/admin-guide/README.rst

Please notice that there are several guides for kernel developers and users.
These guides can be rendered in a number of formats, like HTML and PDF.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

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.