CVE-2023-53608: nilfs2: fix potential UAF of struct nilfs_sc_info in nilfs_segctor_thread()
In the Linux kernel, the following vulnerability has been resolved:
nilfs2: fix potential UAF of struct nilfsscinfo in nilfssegctorthread()
The finalization of nilfssegctorthread() can race with nilfssegctorkillthread() which terminates that thread, potentially causing a use-after-free BUG as KASAN detected.
At the end of nilfssegctorthread(), it assigns NULL to "sctask" member of "struct nilfsscinfo" to indicate the thread has finished, and then notifies nilfssegctorkillthread() of this using waitqueue "scwaittask" on the struct nilfsscinfo.
However, here, immediately after the NULL assignment to "sctask", it is possible that nilfssegctorkillthread() will detect it and return to continue the deallocation, freeing the nilfsscinfo structure before the thread does the notification.
This fixes the issue by protecting the NULL assignment to "sctask" and its notification, with spinlock "scstatelock" of the struct nilfsscinfo. Since nilfssegctorkillthread() does a final check to see if "sctask" is NULL with "scstatelock" locked, this can eliminate the race.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
nilfs2to a version that resolves this vulnerability.Patch nilfs2: fix potential UAF of struct nilfs_sc_info in nilfs_segctor_thread()
Event History
Frequently Asked Questions
What is the severity of CVE-2023-53608?
CVE-2023-53608 is classified as a medium-severity vulnerability in the Linux kernel.
How do I fix CVE-2023-53608?
To resolve CVE-2023-53608, ensure you update to the latest patched version of the Linux kernel.
What impact does CVE-2023-53608 have on my system?
CVE-2023-53608 can potentially lead to a use-after-free condition affecting system stability.
Is CVE-2023-53608 exploitable remotely?
CVE-2023-53608 is not typically exploitable remotely as it requires local system access.
Which versions of the Linux kernel are affected by CVE-2023-53608?
CVE-2023-53608 impacts specific versions of the Linux kernel that utilize the nilfs2 filesystem.