CVE-2024-49959: jbd2: stop waiting for space when jbd2_cleanup_journal_tail() returns error
In the Linux kernel, the following vulnerability has been resolved:
jbd2: stop waiting for space when jbd2cleanupjournaltail() returns error
In jbd2logwaitforspace(), we might call jbd2cleanupjournaltail() to recover some journal space. But if an error occurs while executing jbd2cleanupjournaltail() (e.g., an EIO), we don't stop waiting for free space right away, we try other branches, and if jcommittingtransaction is NULL (i.e., the tid is 0), we will get the following complain:
============================================ JBD2: I/O error when updating journal superblock for sdd-8. jbd2logwaitforspace: needed 256 blocks and only had 217 space available jbd2logwaitforspace: no way to get more journal space in sdd-8 ------------[ cut here ]------------ WARNING: CPU: 2 PID: 139804 at fs/jbd2/checkpoint.c:109 jbd2logwaitforspace+0x251/0x2e0 Modules linked in: CPU: 2 PID: 139804 Comm: kworker/u8:3 Not tainted 6.6.0+ #1 RIP: 0010:jbd2logwaitforspace+0x251/0x2e0 Call Trace: <TASK> addtransactioncredits+0x5d1/0x5e0 startthishandle+0x1ef/0x6a0 jbd2journalstart+0x18b/0x340 ext4dirtyinode+0x5d/0xb0 markinodedirty+0xe4/0x5d0 genericupdatetime+0x60/0x70 [...] ============================================
So only if jbd2cleanupjournaltail() returns 1, i.e., there is nothing to clean up at the moment, continue to try to reclaim free space in other ways.
Note that this fix relies on commit 6f6a6fda2945 ("jbd2: fix ocfs2 corrupt when updating journal superblock fails") to make jbd2cleanupjournaltail return the correct error code.
Other sources
This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.
— Launchpad
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2024-49959?
CVE-2024-49959 has not been explicitly assigned a severity rating, but it addresses a critical issue in the Linux kernel related to journal space management.
How do I fix CVE-2024-49959?
To mitigate CVE-2024-49959, update your Linux kernel to a version that contains the patch, such as 6.1.123-1 or a later stable release.
Which Linux kernel versions are affected by CVE-2024-49959?
CVE-2024-49959 affects Linux kernel versions ranging from 2.6.28 up to 6.11.3, with specific vulnerable versions in between.
Is CVE-2024-49959 a remote exploitation vulnerability?
CVE-2024-49959 does not specifically provide details on remote exploitation capabilities, but it poses risks related to local privilege escalations.
What components of the Linux kernel are impacted by CVE-2024-49959?
CVE-2024-49959 impacts the journaling block device layer, particularly the jbd2 component responsible for managing journal space.