CVE-2025-68814: io_uring: fix filename leak in __io_openat_prep()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
io_uring: fix filename leak in __io_openat_prep()
__io_openat_prep() allocates a struct filename using getname(). However,
for the condition of the file being installed in the fixed file table as well as having O_CLOEXEC flag set, the function returns early. At that point, the request doesn't have REQ_F_NEED_CLEANUP flag set. Due to this, the memory for the newly allocated struct filename is not cleaned up, causing a memory leak.
Fix this by setting the REQ_F_NEED_CLEANUP for the request just after the successful getname() call, so that when the request is torn down, the filename will be cleaned up, along with other resources needing cleanup.
The Linux kernel CVE team has assigned CVE-2025-68814 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.15 with commit b9445598d8c60a1379887b957024b71343965f74 and fixed in 6.1.160 with commit 8f44c4a550570cd5903625133f938c6b51310c9b Issue introduced in 5.15 with commit b9445598d8c60a1379887b957024b71343965f74 and fixed in 6.6.120 with commit 18b99fa603d0df5e1c898699c17d3b92ddc80746 Issue introduced in 5.15 with commit b9445598d8c60a1379887b957024b71343965f74 and fixed in 6.12.64 with commit e232269d511566b1f80872256a48593acc1becf4 Issue introduced in 5.15 with commit b9445598d8c60a1379887b957024b71343965f74 and fixed in 6.18.3 with commit 7fbfb85b05bc960cc50e09d03e5e562131e48d45 Issue introduced in 5.15 with commit b9445598d8c60a1379887b957024b71343965f74 and fixed in 6.19-rc3 with commit b14fad555302a2104948feaff70503b64c80ac01
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-68814
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/openclose.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/8f44c4a550570cd5903625133f938c6b51310c9b https://git.kernel.org/stable/c/18b99fa603d0df5e1c898699c17d3b92ddc80746 https://git.kernel.org/stable/c/e232269d511566b1f80872256a48593acc1becf4 https://git.kernel.org/stable/c/7fbfb85b05bc960cc50e09d03e5e562131e48d45 https://git.kernel.org/stable/c/b14fad555302a2104948feaff70503b64c80ac01