# CVE-2025-23138: watch_queue: fix pipe accounting mismatch

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.22%, higher than 13% of CVEs (2026-12-01)
- Published: 2025-04-16T14:13:17.866Z
- Modified: 2026-11-05T21:17:49.887Z
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

(As written by CVE List.)

## Affected

- Linux Linux: from 162ae0e78bdabf84ef10c1293c4ed7865cb7d3c8 before 8658c75343ed00e5e154ebbe24335f51ba8db547; from 3efbd114b91525bb095b8ae046382197d92126b9 before 471c89b7d4f58bd6082f7c1fe14d4ca15c7f1284; from b87a1229d8668fbc78ebd9ca0fc797a76001c60f before d40e3537265dea9e3c33021874437ff26dc18787; from 68e51bdb1194f11d3452525b99c98aff6f837b24 before 6dafa27764183738dc5368b669b71e3d0d154f12; from e95aada4cb93d42e25c30a0ef9eb2923d9711d4a before 56ec918e6c86c1536870e4373e91eddd0c44245f; from e95aada4cb93d42e25c30a0ef9eb2923d9711d4a before 2d680b988656bb556c863d8b46d9b9096842bf3d; from e95aada4cb93d42e25c30a0ef9eb2923d9711d4a before 205028ebba838938d3b264dda1d0708fa7fe1ade; from e95aada4cb93d42e25c30a0ef9eb2923d9711d4a before f13abc1e8e1a3b7455511c4e122750127f6bc9b0; 6fb70694f8d1ac34e45246b0ac988f025e1e5b55; from 5.10.210 before 5.10.236; from 5.15.149 before 5.15.180; from 6.1.76 before 6.1.134; and 3 more (not affected: before 6.8; from 5.10.236 up to 5.10.*; from 5.15.180 up to 5.15.*; from 6.1.134 up to 6.1.*; from 6.6.87 up to 6.6.*; from 6.12.23 up to 6.12.*; from 6.13.11 up to 6.13.*; from 6.14.2 up to 6.14.*; from 6.15 up to *)
- linux linux_kernel: from 5.10.210 before 5.10.236; from 5.15.149 before 5.15.180; from 6.1.76 before 6.1.134; from 6.6.15 before 6.6.87; from 6.7.3 before 6.12.23; from 6.13 before 6.13.11; from 6.14 before 6.14.2
- debian debian_linux: 11.0

## References

- <https://git.kernel.org/stable/c/8658c75343ed00e5e154ebbe24335f51ba8db547> (patch)
- <https://git.kernel.org/stable/c/471c89b7d4f58bd6082f7c1fe14d4ca15c7f1284> (patch)
- <https://git.kernel.org/stable/c/d40e3537265dea9e3c33021874437ff26dc18787> (patch)
- <https://git.kernel.org/stable/c/6dafa27764183738dc5368b669b71e3d0d154f12> (patch)
- <https://git.kernel.org/stable/c/56ec918e6c86c1536870e4373e91eddd0c44245f> (patch)
- <https://git.kernel.org/stable/c/2d680b988656bb556c863d8b46d9b9096842bf3d> (patch)
- <https://git.kernel.org/stable/c/205028ebba838938d3b264dda1d0708fa7fe1ade> (patch)
- <https://git.kernel.org/stable/c/f13abc1e8e1a3b7455511c4e122750127f6bc9b0> (patch)
- <https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html> (mailing-list)
- <https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html> (mailing-list)

## Sources

- CVE List: [CVE-2025-23138](https://www.cve.org/CVERecord?id=CVE-2025-23138), CVE Terms of Use, modified 2026-11-05
- NVD: [CVE-2025-23138](https://nvd.nist.gov/vuln/detail/CVE-2025-23138), Public domain, modified 2026-11-05

---

Page: https://cve.day/CVE-2025-23138 · Whole record: https://cve.day/CVE-2025-23138.json · Rebuilt by cve.day 2026-11-25T22:58:56.630Z
