CVE-2024-42104·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: nilfs2: add missing check for inode numbers on directory entries Syzbot reported that mounting and unmounting a specific pattern of corrupted nilfs2 filesystem images causes a use-after-free of metadata file inodes, which triggers a kernel bug in lru_add_fn(). As Jan Kara pointed out, this is because the link count of a metadata file gets corrupted to 0, and nilfs_evict_inode(), which is called from iput(), tries to delete that inode (ifile inode in this case). The inconsistency occurs because directories containing the inode numbers of these metadata files that should not be visible in the namespace are read without checking. Fix this issue by treating the inode numbers of these internal files as errors in the sanity check helper when reading directory folios/pages. Also thanks to Hillf Danton and Matthew Wilcox for their initial mm-layer analysis.
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.9.9
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at <0.1% — higher than 1% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Read the two together. CVE-2024-42104 scores 7.8 on CVSS, so a successful attack would be serious — but at <0.1%, almost nobody is currently attempting it. That is a different situation from a flaw under mass exploitation, and it is usually the difference between patching on your next maintenance window and patching tonight.
Affected versions
From: 6.7
Until: 6.9.9
Fixed in: 6.9.9
How to fix this CVE
Update your Linux kernel to version 6.9.9 or later to address a use-after-free vulnerability in the nilfs2 filesystem driver. This vulnerability can be triggered by mounting a maliciously crafted nilfs2 image, leading to kernel crashes or potential privilege escalation. Ensure your system is patched promptly, especially if you handle untrusted filesystem images or run multi-user environments.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Run 'uname -r' to check your current kernel version; if it reports 6.7 through 6.9.8, your system is vulnerable
- Check if nilfs2 filesystem support is enabled with 'grep CONFIG_NILFS2 /boot/config-$(uname -r)'; if set to 'y' or 'm', the component is present
- Search kernel logs with 'sudo dmesg | grep -i "use-after-free\|lru_add_fn\|nilfs"' to identify any crash indicators from corrupted nilfs2 images
- After updating to kernel 6.9.9+, verify with 'uname -r' and confirm the new version is running after reboot
FAQ
What is CVE-2024-42104?
CVE-2024-42104 is a use-after-free vulnerability in the Linux kernel's nilfs2 filesystem driver that occurs when mounting corrupted filesystem images containing invalid inode references. An attacker or user with local access could crash the kernel or potentially escalate privileges by triggering this flaw.
Is CVE-2024-42104 being actively exploited?
No, CVE-2024-42104 is not listed in CISA's Known Exploited Vulnerabilities (KEV) catalog and no public exploits are available. However, the vulnerability is easily triggerable with a specially crafted filesystem image.
What versions of Kernel are affected by CVE-2024-42104?
Linux kernel versions 6.7 through 6.9.8 are vulnerable. Version 6.9.9 and later contain the fix.
How do I check if my server is vulnerable to CVE-2024-42104?
Run 'uname -r' to display your kernel version. If it shows a version between 6.7 and 6.9.8 inclusive, and nilfs2 support is enabled ('grep CONFIG_NILFS2 /boot/config-$(uname -r)'), your system is vulnerable.
Does Defensia detect CVE-2024-42104?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel is installed on a monitored server, CVE-2024-42104 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/07c176e7acc5579c133bb923ab21316d192d0a95
- https://git.kernel.org/stable/c/1b7d549ed2c1fa202c751b69423a0d3a6bd5a180
- https://git.kernel.org/stable/c/265fff1a01cdc083aeaf0d934c929db5cc64aebf
- https://git.kernel.org/stable/c/2f2fa9cf7c3537958a82fbe8c8595a5eb0861ad7
- https://git.kernel.org/stable/c/3ab40870edb883b9633dc5cd55f5a2a11afa618d
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-42104. Free for 1 server.
Get started free