CVE-2025-68240: nilfs2: avoid having an active sc_timer before freeing sci
In the Linux kernel, the following vulnerability has been resolved:
nilfs2: avoid having an active sctimer before freeing sci
Because kthreadstop did not stop sctask properly and returned -EINTR, the sctimer was not properly closed, ultimately causing the problem [1] reported by syzbot when freeing sci due to the sctimer not being closed.
Because the thread sctask main function nilfssegctorthread() returns 0 when it succeeds, when the return value of kthreadstop() is not 0 in nilfssegctordestroy(), we believe that it has not properly closed sctimer.
We use timershutdownsync() to sync wait for sctimer to shutdown, and set the value of sctask to NULL under the protection of lock scstatelock, so as to avoid the issue caused by sctimer not being properly shutdowned.
[1] ODEBUG: free active (active state 0) object: 00000000dacb411a object type: timerlist hint: nilfsconstructiontimeout Call trace: nilfssegctordestroy fs/nilfs2/segment.c:2811 [inline] nilfsdetachlogwriter+0x668/0x8cc fs/nilfs2/segment.c:2877 nilfsputsuper+0x4c/0x12c fs/nilfs2/super.c:509
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In nilfs2 segment cleanup, call timer_shutdown_sync() for sc_timer before freeing sci, and set sc_task to NULL under protection of sc_state_lock to ensure the timer and segment constructor thread are properly shut down.
Event History
Frequently Asked Questions
What is the severity of CVE-2025-68240?
CVE-2025-68240 has a medium severity rating due to the potential for resource leaks and system instability.
How do I fix CVE-2025-68240?
You can fix CVE-2025-68240 by applying the latest patches provided in the Linux kernel to properly manage the sc_timer.
Which Linux kernel versions are affected by CVE-2025-68240?
CVE-2025-68240 affects specific versions of the Linux kernel that utilize the nilfs2 file system.
What is the impact of CVE-2025-68240 on system performance?
The impact of CVE-2025-68240 can lead to degraded performance and increased latency due to improper resource management.
When was CVE-2025-68240 discovered?
CVE-2025-68240 was publicly disclosed as a vulnerability with details available since its resolution date.