# CVE-2024-42304: ext4: make sure the first directory block is not a hole

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.34% (percentile 20, 2026-11-26)
- **Published:** 2024-08-17T09:09:10.545Z
- **Modified:** 2026-10-15T01:18:46.087Z

## Who should check

- Anyone running Linux \>= 3a17ca864baffc0c6f6e8aad525aa4365775a193, \< d81d7e347d1f1f48a5634607d39eb90c161c8afe; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< e02f9941e8c011aa3eafa799def6a134ce06bcfa; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< de2a011a13a46468a6e8259db58b1b62071fe136; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< 9771e3d8365ae1dd5e8846a204cb9af14e3e656a; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< b609753cbbd38f8c0affd4956c0af178348523ac; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< c3893d9de8ee153baac56d127d844103488133b5; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< 299bc6ffa57e04e74c6cce866d6c0741fb4897a1; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< f9ca51596bbfd0f9c386dd1c613c394c78d9e5e6; 3f0307b0d2d8b333a6964fc4c820dc86896fd1cf; 514631c2225c1fd556c799cc1893fb27b0f48f00; …
- Anyone running Linux 5.3

## Description

In the Linux kernel, the following vulnerability has been resolved:

ext4: make sure the first directory block is not a hole

The syzbot constructs a directory that has no dirblock but is non-inline,
i.e. the first directory block is a hole. And no errors are reported when
creating files in this directory in the following flow.

    ext4\_mknod
     ...
      ext4\_add\_entry
        // Read block 0
        ext4\_read\_dirblock(dir, block, DIRENT)
          bh = ext4\_bread(NULL, inode, block, 0)
          if (!bh && (type == INDEX \|\| type == DIRENT\_HTREE))
          // The first directory block is a hole
          // But type == DIRENT, so no error is reported.

After that, we get a directory block without '.' and '..' but with a valid
dentry. This may cause some code that relies on dot or dotdot (such as
make\_indexed\_dir()) to crash.

Therefore when ext4\_read\_dirblock() finds that the first directory block
is a hole report that the filesystem is corrupted and return an error to
avoid loading corrupted data from disk causing something bad.

## Affected and fixed versions

- Linux: \>= 3a17ca864baffc0c6f6e8aad525aa4365775a193, \< d81d7e347d1f1f48a5634607d39eb90c161c8afe; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< e02f9941e8c011aa3eafa799def6a134ce06bcfa; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< de2a011a13a46468a6e8259db58b1b62071fe136; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< 9771e3d8365ae1dd5e8846a204cb9af14e3e656a; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< b609753cbbd38f8c0affd4956c0af178348523ac; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< c3893d9de8ee153baac56d127d844103488133b5; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< 299bc6ffa57e04e74c6cce866d6c0741fb4897a1; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< f9ca51596bbfd0f9c386dd1c613c394c78d9e5e6; 3f0307b0d2d8b333a6964fc4c820dc86896fd1cf; 514631c2225c1fd556c799cc1893fb27b0f48f00; … (cvelist)
- Linux: 5.3 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-42304. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-42304.md
Affected: Linux >= 3a17ca864baffc0c6f6e8aad525aa4365775a193, < d81d7e347d1f1f48a5634607d39eb90c161c8afe; >= 4e19d6b65fb4fc42e352ce9883649e049da14743, < e02f9941e8c011aa3eafa799def6a134ce06bcfa; >= 4e19d6b65fb4fc42e352ce9883649e049da14743, < de2a011a13a46468a6e8259db58b1b62071fe136; >= 4e19d6b65fb4fc42e352ce9…
Fixed in: Linux 9771e3d8365ae1dd5e8846a204cb9af14e3e656a, Linux 299bc6ffa57e04e74c6cce866d6c0741fb4897a1

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-42304 being exploited?

There is no confirmed exploitation: CVE-2024-42304 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.34% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-42304?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-42304?

Linux \>= 3a17ca864baffc0c6f6e8aad525aa4365775a193, \< d81d7e347d1f1f48a5634607d39eb90c161c8afe; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< e02f9941e8c011aa3eafa799def6a134ce06bcfa; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< de2a011a13a46468a6e8259db58b1b62071fe136; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< 9771e3d8365ae1dd5e8846a204cb9af14e3e656a; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< b609753cbbd38f8c0affd4956c0af178348523ac; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< c3893d9de8ee153baac56d127d844103488133b5; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< 299bc6ffa57e04e74c6cce866d6c0741fb4897a1; \>= 4e19d6b65fb4fc42e352ce9883649e049da14743, \< f9ca51596bbfd0f9c386dd1c613c394c78d9e5e6; 3f0307b0d2d8b333a6964fc4c820dc86896fd1cf; 514631c2225c1fd556c799cc1893fb27b0f48f00; …; Linux 5.3.

### Is there a fix for CVE-2024-42304?

Yes. Fixed in Linux 9771e3d8365ae1dd5e8846a204cb9af14e3e656a, Linux 299bc6ffa57e04e74c6cce866d6c0741fb4897a1. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2024-42304?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/d81d7e347d1f1f48a5634607d39eb90c161c8afe>
- patch: <https://git.kernel.org/stable/c/e02f9941e8c011aa3eafa799def6a134ce06bcfa>
- patch: <https://git.kernel.org/stable/c/de2a011a13a46468a6e8259db58b1b62071fe136>
- patch: <https://git.kernel.org/stable/c/9771e3d8365ae1dd5e8846a204cb9af14e3e656a>
- patch: <https://git.kernel.org/stable/c/b609753cbbd38f8c0affd4956c0af178348523ac>
- patch: <https://git.kernel.org/stable/c/c3893d9de8ee153baac56d127d844103488133b5>
- patch: <https://git.kernel.org/stable/c/299bc6ffa57e04e74c6cce866d6c0741fb4897a1>
- patch: <https://git.kernel.org/stable/c/f9ca51596bbfd0f9c386dd1c613c394c78d9e5e6>
- other: <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>
- other: <https://lists.debian.org/debian-lts-announce/2024/10/msg00003.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-265688.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-42304>

HTML: <https://flawdb.com/CVE-2024-42304> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-42304>
