Go to file
Greg Thelen bd40513d0b perf/core: Avoid put_page() when GUP fails
commit 4716023a8f6a0f4a28047f14dd7ebdc319606b84 upstream.

PEBS PERF_SAMPLE_PHYS_ADDR events use perf_virt_to_phys() to convert PMU
sampled virtual addresses to physical using get_user_page_fast_only()
and page_to_phys().

Some get_user_page_fast_only() error cases return false, indicating no
page reference, but still initialize the output page pointer with an
unreferenced page. In these error cases perf_virt_to_phys() calls
put_page(). This causes page reference count underflow, which can lead
to unintentional page sharing.

Fix perf_virt_to_phys() to only put_page() if get_user_page_fast_only()
returns a referenced page.

Fixes: fc7ce9c74c ("perf/core, x86: Add PERF_SAMPLE_PHYS_ADDR")
Signed-off-by: Greg Thelen <gthelen@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20211111021814.757086-1-gthelen@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-21 13:46:37 +01:00
arch parisc/entry: fix trace test in syscall exit path 2021-11-21 13:46:36 +01:00
block block: remove inaccurate requeue check 2021-11-18 14:03:58 +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 fscrypt: allow 256-bit master keys with AES-256-XTS 2021-11-18 14:03:54 +01:00
drivers PCI: Add MSI masking quirk for Nvidia ION AHCI 2021-11-21 13:46:37 +01:00
fs erofs: fix unsafe pagevec reuse of hooked pclusters 2021-11-21 13:46:37 +01:00
include PCI/MSI: Deal with devices lying about their MSI mask capability 2021-11-21 13:46:36 +01:00
init bootconfig: init: Fix memblock leak in xbc_make_cmdline() 2021-11-21 13:46:35 +01:00
ipc ipc/mqueue, msg, sem: avoid relying on a stack reference past its expiry 2021-05-26 12:06:54 +02:00
kernel perf/core: Avoid put_page() when GUP fails 2021-11-21 13:46:37 +01:00
lib lib/xz: Validate the value before assigning it to an enum variable 2021-11-18 14:03:58 +01:00
LICENSES
mm mm, oom: do not trigger out_of_memory from the #PF 2021-11-18 14:04:30 +01:00
net SUNRPC: Partial revert of commit 6f9f17287e 2021-11-18 14:04:32 +01:00
samples samples/kretprobes: Fix return value if register_kretprobe() failed 2021-11-18 14:04:11 +01:00
scripts scripts/lld-version.sh: Rewrite based on upstream ld-version.sh 2021-11-21 13:46:37 +01:00
security fortify: Explicitly disable Clang support 2021-11-21 13:46:35 +01:00
sound ASoC: cs42l42: Correct configuring of switch inversion from ts-inv 2021-11-18 14:04:21 +01:00
tools selftests/bpf: Fix also no-alu32 strobemeta selftest 2021-11-18 14:04:32 +01:00
usr
virt KVM: do not shrink halt_poll_ns below grow_start 2021-10-09 14:40:58 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile Linux 5.10.80 2021-11-18 14:04:33 +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.