Bug 2297497 (CVE-2024-40913) - CVE-2024-40913 kernel: cachefiles: defer exposing anon_fd until after copy_to_user() succeeds
Summary: CVE-2024-40913 kernel: cachefiles: defer exposing anon_fd until after copy_to...
Keywords:
Status: NEW
Alias: CVE-2024-40913
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: 2024-07-12 13:30 UTC by OSIDB Bzimport
Modified: 2024-07-29 21:39 UTC (History)
4 users (show)

Fixed In Version: kernel 6.1.95, kernel 6.6.35, kernel 6.9.6, kernel 6.10-rc4
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2024-07-12 13:30:53 UTC
In the Linux kernel, the following vulnerability has been resolved:

cachefiles: defer exposing anon_fd until after copy_to_user() succeeds

After installing the anonymous fd, we can now see it in userland and close
it. However, at this point we may not have gotten the reference count of
the cache, but we will put it during colse fd, so this may cause a cache
UAF.

So grab the cache reference count before fd_install(). In addition, by
kernel convention, fd is taken over by the user land after fd_install(),
and the kernel should not call close_fd() after that, i.e., it should call
fd_install() after everything is ready, thus fd_install() is called after
copy_to_user() succeeds.


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