CVE-2025-38730: io_uring/net: commit partial buffers on retry
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
io_uring/net: commit partial buffers on retry
Ring provided buffers are potentially only valid within the single execution context in which they were acquired. io_uring deals with this and invalidates them on retry. But on the networking side, if MSG_WAITALL is set, or if the socket is of the streaming type and too little was processed, then it will hang on to the buffer rather than recycle or commit it. This is problematic for two reasons:
1) If someone unregisters the provided buffer ring before a later retry, then the req->buf_list will no longer be valid.
2) If multiple sockers are using the same buffer group, then multiple receives can consume the same memory. This can cause data corruption in the application, as either receive could land in the same userspace buffer.
Fix this by disallowing partial retries from pinning a provided buffer across multiple executions, if ring provided buffers are used.
The Linux kernel CVE team has assigned CVE-2025-38730 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.4 with commit c56e022c0a27142b7b59ae6bdf45f86bf4b298a1 and fixed in 6.6.103 with commit 3b53dc1c641f2884d4750fc25aaf6c36b90db606 Issue introduced in 6.4 with commit c56e022c0a27142b7b59ae6bdf45f86bf4b298a1 and fixed in 6.12.44 with commit fe9da1812f8697a38f7e30991d568ec199e16059 Issue introduced in 6.4 with commit c56e022c0a27142b7b59ae6bdf45f86bf4b298a1 and fixed in 6.15.11 with commit 21a4ddb0f5e933f372808c10b9ac704505751bb1 Issue introduced in 6.4 with commit c56e022c0a27142b7b59ae6bdf45f86bf4b298a1 and fixed in 6.16.2 with commit 2eb7937b5fc7fcd90eab7bebb0181214b61b9283 Issue introduced in 6.4 with commit c56e022c0a27142b7b59ae6bdf45f86bf4b298a1 and fixed in 6.17-rc2 with commit 41b70df5b38bc80967d2e0ed55cc3c3896bba781
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2025-38730
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
io_uring/net.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/3b53dc1c641f2884d4750fc25aaf6c36b90db606 https://git.kernel.org/stable/c/fe9da1812f8697a38f7e30991d568ec199e16059 https://git.kernel.org/stable/c/21a4ddb0f5e933f372808c10b9ac704505751bb1 https://git.kernel.org/stable/c/2eb7937b5fc7fcd90eab7bebb0181214b61b9283 https://git.kernel.org/stable/c/41b70df5b38bc80967d2e0ed55cc3c3896bba781