CVE-2024-42104

nilfs2: add missing check for inode numbers on directory entries

HIGH
7.8
CVSS Score
Published: July 30, 2024 at 07:46 AM UTC
Updated: August 5, 2026 at 12:04 PM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.8
Exploit prediction
EPSS 0.3%
SSVC
No known exploit

Description

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 4.19.3182.6.30 ≤ v < 4.19.3182.6.30 ≤ v < 5.10.2222.6.30 ≤ v < 5.15.1632.6.30 ≤ v < 5.4.2802.6.30 ≤ v < 6.1.982.6.30 ≤ v < 6.102.6.30 ≤ v < 6.6.392.6.30 ≤ v < 6.9.94.20 ≤ v < 5.4.2805.11 ≤ v < 5.15.1635.16 ≤ v < 6.1.985.5 ≤ v < 5.10.2226.2 ≤ v < 6.6.396.7 ≤ v < 6.9.92.6.302ba466d74ed74f073257f86e61519cb8f8f46184
Vendor states this is fixed in 07c176e7acc5579c133bb923ab21316d192d0a95 (fixed)
Vendor states this is fixed in 1b7d549ed2c1fa202c751b69423a0d3a6bd5a180 (fixed)
Vendor states this is fixed in 265fff1a01cdc083aeaf0d934c929db5cc64aebf (fixed)
Vendor states this is fixed in 2f2fa9cf7c3537958a82fbe8c8595a5eb0861ad7 (fixed)
Vendor states this is fixed in 3ab40870edb883b9633dc5cd55f5a2a11afa618d (fixed)
Vendor states this is fixed in b11e8fb93ea5eefb2e4e719497ea177a58ff6131 (fixed)
Vendor states this is fixed in bb76c6c274683c8570ad788f79d4b875bde0e458 (fixed)
Vendor states this is fixed in c33c2b0d92aa1c2262d999b2598ad6fbd53bd479 (fixed)
Vendor states this is fixed in 2.6.30 (unaffected)
Vendor states this is fixed in 4.19.318 (unaffected)
Vendor states this is fixed in 5.10.222 (unaffected)
Vendor states this is fixed in 5.15.163 (unaffected)
Vendor states this is fixed in 5.4.280 (unaffected)
Vendor states this is fixed in 6.1.98 (unaffected)
Vendor states this is fixed in 6.10 (unaffected)
Vendor states this is fixed in 6.6.39 (unaffected)
Vendor states this is fixed in 6.9.9 (unaffected)

References (9)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/07c176e7acc5579c133bb923ab21316d192d0a95
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/1b7d549ed2c1fa202c751b69423a0d3a6bd5a180
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/265fff1a01cdc083aeaf0d934c929db5cc64aebf
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/2f2fa9cf7c3537958a82fbe8c8595a5eb0861ad7
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/3ab40870edb883b9633dc5cd55f5a2a11afa618d
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/b11e8fb93ea5eefb2e4e719497ea177a58ff6131
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/bb76c6c274683c8570ad788f79d4b875bde0e458
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/c33c2b0d92aa1c2262d999b2598ad6fbd53bd479

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

7.8HIGHLinux
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-416

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card