# CVE-2024-49882: ext4: fix double brelse() the buffer of the extents path

> 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.36% (percentile 22, 2026-11-26)
- **CWE:** CWE-415
- **Published:** 2024-10-21T18:01:20.144Z
- **Modified:** 2026-08-05T11:40:20.352Z

## Who should check

- Anyone running Linux \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< d4574bda63906bf69660e001470bfe1a0ac524ae; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< f9fd47c9d9548f9e47fa60098eab99dde175401d; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< b6c29c8f3d7cb67b505f3b2f6c242d52298d1f2e; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< 32bbb59e3f18facd7201bef110010bf35819b8c3; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< 78bbc3d15b6f443acb26e94418c445bac940d414; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< 68a69cf60660c73990c1875f94a5551600b04775; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< 7633407ca4ab8be2916ab214eb44ccebc6a50e1a; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< 230ee0535d01478bad9a3037292043f39b9be10b; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< dcaa6c31134c0f515600111c38ed7750003e1b9c
- Anyone running Linux 3.7

## Description

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

ext4: fix double brelse() the buffer of the extents path

In ext4\_ext\_try\_to\_merge\_up(), set path\[1\].p\_bh to NULL after it has been
released, otherwise it may be released twice. An example of what triggers
this is as follows:

  split2    map    split1
\|--------\|-------\|--------\|

ext4\_ext\_map\_blocks
 ext4\_ext\_handle\_unwritten\_extents
  ext4\_split\_convert\_extents
   // path-\>p\_depth == 0
   ext4\_split\_extent
     // 1. do split1
     ext4\_split\_extent\_at
       \|ext4\_ext\_insert\_extent
       \|  ext4\_ext\_create\_new\_leaf
       \|    ext4\_ext\_grow\_indepth
       \|      le16\_add\_cpu(&neh-\>eh\_depth, 1)
       \|    ext4\_find\_extent
       \|      // return -ENOMEM
       \|// get error and try zeroout
       \|path = ext4\_find\_extent
       \|  path-\>p\_depth = 1
       \|ext4\_ext\_try\_to\_merge
       \|  ext4\_ext\_try\_to\_merge\_up
       \|    path-\>p\_depth = 0
       \|    brelse(path\[1\].p\_bh)  ---\> not set to NULL here
       \|// zeroout success
     // 2. update path
     ext4\_find\_extent
     // 3. do split2
     ext4\_split\_extent\_at
       ext4\_ext\_insert\_extent
         ext4\_ext\_create\_new\_leaf
           ext4\_ext\_grow\_indepth
             le16\_add\_cpu(&neh-\>eh\_depth, 1)
           ext4\_find\_extent
             path\[0\].p\_bh = NULL;
             path-\>p\_depth = 1
             read\_extent\_tree\_block  ---\> return err
             // path\[1\].p\_bh is still the old value
             ext4\_free\_ext\_path
               ext4\_ext\_drop\_refs
                 // path-\>p\_depth == 1
                 brelse(path\[1\].p\_bh)  ---\> brelse a buffer twice

Finally got the following WARRNING when removing the buffer from lru:

============================================
VFS: brelse: Trying to free free buffer
WARNING: CPU: 2 PID: 72 at fs/buffer.c:1241 \_\_brelse+0x58/0x90
CPU: 2 PID: 72 Comm: kworker/u19:1 Not tainted 6.9.0-dirty \#716
RIP: 0010:\_\_brelse+0x58/0x90
Call Trace:
 \<TASK\>
 \_\_find\_get\_block+0x6e7/0x810
 bdev\_getblk+0x2b/0x480
 \_\_ext4\_get\_inode\_loc+0x48a/0x1240
 ext4\_get\_inode\_loc+0xb2/0x150
 ext4\_reserve\_inode\_write+0xb7/0x230
 \_\_ext4\_mark\_inode\_dirty+0x144/0x6a0
 ext4\_ext\_insert\_extent+0x9c8/0x3230
 ext4\_ext\_map\_blocks+0xf45/0x2dc0
 ext4\_map\_blocks+0x724/0x1700
 ext4\_do\_writepages+0x12d6/0x2a70
\[...\]
============================================

## Affected and fixed versions

- Linux: \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< d4574bda63906bf69660e001470bfe1a0ac524ae; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< f9fd47c9d9548f9e47fa60098eab99dde175401d; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< b6c29c8f3d7cb67b505f3b2f6c242d52298d1f2e; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< 32bbb59e3f18facd7201bef110010bf35819b8c3; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< 78bbc3d15b6f443acb26e94418c445bac940d414; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< 68a69cf60660c73990c1875f94a5551600b04775; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< 7633407ca4ab8be2916ab214eb44ccebc6a50e1a; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< 230ee0535d01478bad9a3037292043f39b9be10b; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< dcaa6c31134c0f515600111c38ed7750003e1b9c (cvelist)
- Linux: 3.7 (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-49882. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-49882.md
Affected: Linux >= ecb94f5fdf4b72547fca022421a9dca1672bddd4, < d4574bda63906bf69660e001470bfe1a0ac524ae; >= ecb94f5fdf4b72547fca022421a9dca1672bddd4, < f9fd47c9d9548f9e47fa60098eab99dde175401d; >= ecb94f5fdf4b72547fca022421a9dca1672bddd4, < b6c29c8f3d7cb67b505f3b2f6c242d52298d1f2e; >= ecb94f5fdf4b72547fca022…
Fixed in: Linux 32bbb59e3f18facd7201bef110010bf35819b8c3, Linux 78bbc3d15b6f443acb26e94418c445bac940d414, Linux 68a69cf60660c73990c1875f94a5551600b04775, Linux 7633407ca4ab8be2916ab214eb44ccebc6a50e1a, Linux 230ee0535d01478bad9a3037292043f39b9be10b

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-49882 being exploited?

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

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

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

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

Linux \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< d4574bda63906bf69660e001470bfe1a0ac524ae; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< f9fd47c9d9548f9e47fa60098eab99dde175401d; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< b6c29c8f3d7cb67b505f3b2f6c242d52298d1f2e; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< 32bbb59e3f18facd7201bef110010bf35819b8c3; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< 78bbc3d15b6f443acb26e94418c445bac940d414; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< 68a69cf60660c73990c1875f94a5551600b04775; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< 7633407ca4ab8be2916ab214eb44ccebc6a50e1a; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< 230ee0535d01478bad9a3037292043f39b9be10b; \>= ecb94f5fdf4b72547fca022421a9dca1672bddd4, \< dcaa6c31134c0f515600111c38ed7750003e1b9c; Linux 3.7.

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

Yes. Fixed in Linux 32bbb59e3f18facd7201bef110010bf35819b8c3, Linux 78bbc3d15b6f443acb26e94418c445bac940d414, Linux 68a69cf60660c73990c1875f94a5551600b04775, Linux 7633407ca4ab8be2916ab214eb44ccebc6a50e1a, Linux 230ee0535d01478bad9a3037292043f39b9be10b. No fix listed yet: follow the vendor advisory.

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

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/d4574bda63906bf69660e001470bfe1a0ac524ae>
- patch: <https://git.kernel.org/stable/c/f9fd47c9d9548f9e47fa60098eab99dde175401d>
- patch: <https://git.kernel.org/stable/c/b6c29c8f3d7cb67b505f3b2f6c242d52298d1f2e>
- patch: <https://git.kernel.org/stable/c/32bbb59e3f18facd7201bef110010bf35819b8c3>
- patch: <https://git.kernel.org/stable/c/78bbc3d15b6f443acb26e94418c445bac940d414>
- patch: <https://git.kernel.org/stable/c/68a69cf60660c73990c1875f94a5551600b04775>
- patch: <https://git.kernel.org/stable/c/7633407ca4ab8be2916ab214eb44ccebc6a50e1a>
- patch: <https://git.kernel.org/stable/c/230ee0535d01478bad9a3037292043f39b9be10b>
- patch: <https://git.kernel.org/stable/c/dcaa6c31134c0f515600111c38ed7750003e1b9c>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html>
- other: <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.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-49882>

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