Bug 2360211 (CVE-2025-23138) - CVE-2025-23138 kernel: watch_queue: fix pipe accounting mismatch
Summary: CVE-2025-23138 kernel: watch_queue: fix pipe accounting mismatch
Keywords:
Status: NEW
Alias: CVE-2025-23138
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-04-16 15:02 UTC by OSIDB Bzimport
Modified: 2025-04-17 14:36 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2025-04-16 15:02:51 UTC
In the Linux kernel, the following vulnerability has been resolved:

watch_queue: fix pipe accounting mismatch

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()?)

Comment 1 Avinash Hanwate 2025-04-17 14:29:47 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2025041634-CVE-2025-23138-a5c8@gregkh/T


Note You need to log in before you can comment on or make changes to this bug.