Go to file
Eric Sandeen 471c89b7d4 watch_queue: fix pipe accounting mismatch
[ Upstream commit f13abc1e8e ]

Currently, watch_queue_set_size() modifies the pipe buffers charged to
user->pipe_bufs without updating the pipe->nr_accounted on the pipe
itself, due to the if (!pipe_has_watch_queue()) test in
pipe_resize_ring(). This means that when the pipe is ultimately freed,
we decrement user->pipe_bufs by something other than what than we had
charged to it, potentially leading to an underflow. This in turn can
cause subsequent too_many_pipe_buffers_soft() tests to fail with -EPERM.

To remedy this, explicitly account for the pipe usage in
watch_queue_set_size() to match the number set via account_pipe_buffers()

(It's unclear why watch_queue_set_size() does not update nr_accounted;
it may be due to intentional overprovisioning in watch_queue_set_size()?)

Fixes: e95aada4cb ("pipe: wakeup wr_wait after setting max_usage")
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Link: https://lore.kernel.org/r/206682a8-0604-49e5-8224-fdbe0c12b460@redhat.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-04-10 14:31:57 +02:00
arch ARM: Remove address checking for MMUless devices 2025-04-10 14:31:56 +02:00
block block: fix 'kmem_cache of name 'bio-108' already exists' 2025-04-10 14:31:51 +02:00
certs
crypto
Documentation sched/isolation: Prevent boot crash when the boot CPU is nohz_full 2025-04-10 14:31:48 +02:00
drivers media: i2c: et8ek8: Don't strip remove function when driver is builtin 2025-04-10 14:31:56 +02:00
fs proc: fix UAF in proc_get_inode() 2025-04-10 14:31:55 +02:00
include proc: fix UAF in proc_get_inode() 2025-04-10 14:31:55 +02:00
init
io_uring
ipc
kernel watch_queue: fix pipe accounting mismatch 2025-04-10 14:31:57 +02:00
lib lib/buildid: Handle memfd_secret() files in build_id_parse() 2025-04-10 14:31:52 +02:00
LICENSES
mm slab: Introduce kmalloc_size_roundup() 2025-04-10 14:31:49 +02:00
net netfilter: socket: Lookup orig tuple for IPv6 SNAT 2025-04-10 14:31:56 +02:00
samples
scripts
security
sound ALSA: hda/realtek: Support mute LED on HP Laptop 15s-du3xxx 2025-04-10 14:31:56 +02:00
tools
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile Linux 5.15.179 2025-03-13 12:51:13 +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.