Go to file
Steven Rostedt (Google) 321dca2afd ring-buffer: Fix memory leak of free page
commit 17d8017581 upstream.

Reading the ring buffer does a swap of a sub-buffer within the ring buffer
with a empty sub-buffer. This allows the reader to have full access to the
content of the sub-buffer that was swapped out without having to worry
about contention with the writer.

The readers call ring_buffer_alloc_read_page() to allocate a page that
will be used to swap with the ring buffer. When the code is finished with
the reader page, it calls ring_buffer_free_read_page(). Instead of freeing
the page, it stores it as a spare. Then next call to
ring_buffer_alloc_read_page() will return this spare instead of calling
into the memory management system to allocate a new page.

Unfortunately, on freeing of the ring buffer, this spare page is not
freed, and causes a memory leak.

Link: https://lore.kernel.org/linux-trace-kernel/20231210221250.7b9cc83c@rorschach.local.home

Cc: stable@vger.kernel.org
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fixes: 73a757e631 ("ring-buffer: Return reader page back into existing ring buffer")
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-12-20 15:32:38 +01:00
Documentation Documentation: security-bugs.rst: update preferences when dealing with the linux-distros group 2023-08-11 11:33:53 +02:00
arch KVM: s390/mm: Properly reset no-dat 2023-12-13 16:46:17 +01:00
block blk-throttle: fix lockdep warning of "cgroup_mutex or RCU read lock required!" 2023-12-20 15:32:35 +01:00
certs certs/blacklist_hashes.c: fix const confusion in certs blacklist 2022-06-25 11:46:44 +02:00
crypto crypto: pcrypt - Fix hungtask for PADATA_RESET 2023-11-28 16:45:43 +00:00
drivers team: Fix use-after-free when an option instance allocation fails 2023-12-20 15:32:38 +01:00
firmware Fix built-in early-load Intel microcode alignment 2020-01-23 08:20:30 +01:00
fs ext4: prevent the normalized size from exceeding EXT_MAX_BLOCKS 2023-12-20 15:32:38 +01:00
include asm-generic: qspinlock: fix queued_spin_value_unlocked() implementation 2023-12-20 15:32:37 +01:00
init init, x86: Move mem_encrypt_init() into arch_cpu_finalize_init() 2023-08-08 19:48:24 +02:00
ipc ipc/sem: Fix dangling sem_array access in semtimedop race 2022-12-08 11:16:33 +01:00
kernel ring-buffer: Fix memory leak of free page 2023-12-20 15:32:38 +01:00
lib kobject: Fix slab-out-of-bounds in fill_kobj_path() 2023-11-08 11:21:07 +01:00
mm treewide: Remove uninitialized_var() usage 2023-08-11 11:33:32 +02:00
net appletalk: Fix Use-After-Free in atalk_ioctl 2023-12-20 15:32:34 +01:00
samples samples/kretprobes: Fix return value if register_kretprobe() failed 2021-11-26 11:40:31 +01:00
scripts sign-file: Fix incorrect return values check 2023-12-20 15:32:34 +01:00
security smackfs: Prevent underflow in smk_set_cipso() 2023-09-23 10:46:56 +02:00
sound ALSA: pcm: fix out-of-bounds in snd_pcm_state_names 2023-12-13 16:46:16 +01:00
tools selftests/efivarfs: create-read: fix a resource leak 2023-11-28 16:45:43 +00:00
usr initramfs: restore default compression behavior 2020-04-13 10:34:19 +02:00
virt KVM: arm64: vgic: Fix exit condition in scan_its_table() 2022-11-03 23:50:50 +09:00
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS Remove DECnet support from kernel 2023-06-21 15:38:58 +02:00
Makefile Linux 4.14.333 2023-12-13 16:46:18 +01:00
README

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.