# CVE-2022-49276: jffs2: fix memory leak in jffs2\_scan\_medium

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; 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.29% (percentile 14, 2026-11-26)
- **CWE:** CWE-401
- **Published:** 2025-02-26T01:56:20.559Z
- **Modified:** 2026-06-17T05:17:34.400Z

## Who should check

- Anyone running Linux \>= e631ddba588783edd521c5a89f7b2902772fb691, \< 9b0c69182f09b70779817af4dcf89780955d5c4c; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< b36bccb04e14cc0c1e2d0e92d477fe220314fad6; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< e711913463af916d777a4873068f415f1fe2ad33; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< 455f4a23490bfcbedc8e5c245c463a59b19e5ddd; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< 51dbb5e36d59f62e34d462b801c1068248149cfe; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< 52ba0ab4f0a606f02a6163493378989faa1ec10a; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< b26bbc0c122cad038831f226a4cb4de702225e16; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< 82462324bf35b6b553400af1c1aa265069cee28f; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< 9cdd3128874f5fe759e2c4e1360ab7fb96a8d1df
- Anyone running Linux 2.6.15

## Description

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

jffs2: fix memory leak in jffs2\_scan\_medium

If an error is returned in jffs2\_scan\_eraseblock() and some memory
has been added to the jffs2\_summary \*s, we can observe the following
kmemleak report:

--------------------------------------------
unreferenced object 0xffff88812b889c40 (size 64):
  comm "mount", pid 692, jiffies 4294838325 (age 34.288s)
  hex dump (first 32 bytes):
    40 48 b5 14 81 88 ff ff 01 e0 31 00 00 00 50 00  @H........1...P.
    00 00 01 00 00 00 01 00 00 00 02 00 00 00 09 08  ................
  backtrace:
    \[\<ffffffffae93a3a3\>\] \_\_kmalloc+0x613/0x910
    \[\<ffffffffaf423b9c\>\] jffs2\_sum\_add\_dirent\_mem+0x5c/0xa0
    \[\<ffffffffb0f3afa8\>\] jffs2\_scan\_medium.cold+0x36e5/0x4794
    \[\<ffffffffb0f3dbe1\>\] jffs2\_do\_mount\_fs.cold+0xa7/0x2267
    \[\<ffffffffaf40acf3\>\] jffs2\_do\_fill\_super+0x383/0xc30
    \[\<ffffffffaf40c00a\>\] jffs2\_fill\_super+0x2ea/0x4c0
    \[\<ffffffffb0315d64\>\] mtd\_get\_sb+0x254/0x400
    \[\<ffffffffb0315f5f\>\] mtd\_get\_sb\_by\_nr+0x4f/0xd0
    \[\<ffffffffb0316478\>\] get\_tree\_mtd+0x498/0x840
    \[\<ffffffffaf40bd15\>\] jffs2\_get\_tree+0x25/0x30
    \[\<ffffffffae9f358d\>\] vfs\_get\_tree+0x8d/0x2e0
    \[\<ffffffffaea7a98f\>\] path\_mount+0x50f/0x1e50
    \[\<ffffffffaea7c3d7\>\] do\_mount+0x107/0x130
    \[\<ffffffffaea7c5c5\>\] \_\_se\_sys\_mount+0x1c5/0x2f0
    \[\<ffffffffaea7c917\>\] \_\_x64\_sys\_mount+0xc7/0x160
    \[\<ffffffffb10142f5\>\] do\_syscall\_64+0x45/0x70
unreferenced object 0xffff888114b54840 (size 32):
  comm "mount", pid 692, jiffies 4294838325 (age 34.288s)
  hex dump (first 32 bytes):
    c0 75 b5 14 81 88 ff ff 02 e0 02 00 00 00 02 00  .u..............
    00 00 84 00 00 00 44 00 00 00 6b 6b 6b 6b 6b a5  ......D...kkkkk.
  backtrace:
    \[\<ffffffffae93be24\>\] kmem\_cache\_alloc\_trace+0x584/0x880
    \[\<ffffffffaf423b04\>\] jffs2\_sum\_add\_inode\_mem+0x54/0x90
    \[\<ffffffffb0f3bd44\>\] jffs2\_scan\_medium.cold+0x4481/0x4794
    \[...\]
unreferenced object 0xffff888114b57280 (size 32):
  comm "mount", pid 692, jiffies 4294838393 (age 34.357s)
  hex dump (first 32 bytes):
    10 d5 6c 11 81 88 ff ff 08 e0 05 00 00 00 01 00  ..l.............
    00 00 38 02 00 00 28 00 00 00 6b 6b 6b 6b 6b a5  ..8...(...kkkkk.
  backtrace:
    \[\<ffffffffae93be24\>\] kmem\_cache\_alloc\_trace+0x584/0x880
    \[\<ffffffffaf423c34\>\] jffs2\_sum\_add\_xattr\_mem+0x54/0x90
    \[\<ffffffffb0f3a24f\>\] jffs2\_scan\_medium.cold+0x298c/0x4794
    \[...\]
unreferenced object 0xffff8881116cd510 (size 16):
  comm "mount", pid 692, jiffies 4294838395 (age 34.355s)
  hex dump (first 16 bytes):
    00 00 00 00 00 00 00 00 09 e0 60 02 00 00 6b a5  ..........\`...k.
  backtrace:
    \[\<ffffffffae93be24\>\] kmem\_cache\_alloc\_trace+0x584/0x880
    \[\<ffffffffaf423cc4\>\] jffs2\_sum\_add\_xref\_mem+0x54/0x90
    \[\<ffffffffb0f3b2e3\>\] jffs2\_scan\_medium.cold+0x3a20/0x4794
    \[...\]
--------------------------------------------

Therefore, we should call jffs2\_sum\_reset\_collected(s) on exit to
release the memory added in s. In addition, a new tag "out\_buf" is
added to prevent the NULL pointer reference caused by s being NULL.
(thanks to Zhang Yi for this analysis)

## Affected and fixed versions

- Linux: \>= e631ddba588783edd521c5a89f7b2902772fb691, \< 9b0c69182f09b70779817af4dcf89780955d5c4c; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< b36bccb04e14cc0c1e2d0e92d477fe220314fad6; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< e711913463af916d777a4873068f415f1fe2ad33; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< 455f4a23490bfcbedc8e5c245c463a59b19e5ddd; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< 51dbb5e36d59f62e34d462b801c1068248149cfe; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< 52ba0ab4f0a606f02a6163493378989faa1ec10a; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< b26bbc0c122cad038831f226a4cb4de702225e16; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< 82462324bf35b6b553400af1c1aa265069cee28f; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< 9cdd3128874f5fe759e2c4e1360ab7fb96a8d1df (cvelist)
- Linux: 2.6.15 (cvelist)

## Mitigation

- Upgrade Linux to 9cdd3128874f5fe759e2c4e1360ab7fb96a8d1df or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2022-49276.md
Affected: Linux >= e631ddba588783edd521c5a89f7b2902772fb691, < 9b0c69182f09b70779817af4dcf89780955d5c4c; >= e631ddba588783edd521c5a89f7b2902772fb691, < b36bccb04e14cc0c1e2d0e92d477fe220314fad6; >= e631ddba588783edd521c5a89f7b2902772fb691, < e711913463af916d777a4873068f415f1fe2ad33; >= e631ddba588783edd521c5a…
Fixed in: Linux 9b0c69182f09b70779817af4dcf89780955d5c4c, Linux 455f4a23490bfcbedc8e5c245c463a59b19e5ddd, Linux 51dbb5e36d59f62e34d462b801c1068248149cfe, Linux 52ba0ab4f0a606f02a6163493378989faa1ec10a, Linux 82462324bf35b6b553400af1c1aa265069cee28f, Linux 9cdd3128874f5fe759e2c4e1360ab7fb96a8d1df

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-2022-49276 being exploited?

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

### How serious is CVE-2022-49276?

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

### Which versions are affected by CVE-2022-49276?

Linux \>= e631ddba588783edd521c5a89f7b2902772fb691, \< 9b0c69182f09b70779817af4dcf89780955d5c4c; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< b36bccb04e14cc0c1e2d0e92d477fe220314fad6; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< e711913463af916d777a4873068f415f1fe2ad33; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< 455f4a23490bfcbedc8e5c245c463a59b19e5ddd; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< 51dbb5e36d59f62e34d462b801c1068248149cfe; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< 52ba0ab4f0a606f02a6163493378989faa1ec10a; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< b26bbc0c122cad038831f226a4cb4de702225e16; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< 82462324bf35b6b553400af1c1aa265069cee28f; \>= e631ddba588783edd521c5a89f7b2902772fb691, \< 9cdd3128874f5fe759e2c4e1360ab7fb96a8d1df; Linux 2.6.15.

### Is there a fix for CVE-2022-49276?

Yes. Fixed in Linux 9b0c69182f09b70779817af4dcf89780955d5c4c, Linux 455f4a23490bfcbedc8e5c245c463a59b19e5ddd, Linux 51dbb5e36d59f62e34d462b801c1068248149cfe, Linux 52ba0ab4f0a606f02a6163493378989faa1ec10a, Linux 82462324bf35b6b553400af1c1aa265069cee28f, Linux 9cdd3128874f5fe759e2c4e1360ab7fb96a8d1df. Upgrade Linux to 9cdd3128874f5fe759e2c4e1360ab7fb96a8d1df or later.

### How do I check if I'm affected by CVE-2022-49276?

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/9b0c69182f09b70779817af4dcf89780955d5c4c>
- patch: <https://git.kernel.org/stable/c/b36bccb04e14cc0c1e2d0e92d477fe220314fad6>
- patch: <https://git.kernel.org/stable/c/e711913463af916d777a4873068f415f1fe2ad33>
- patch: <https://git.kernel.org/stable/c/455f4a23490bfcbedc8e5c245c463a59b19e5ddd>
- patch: <https://git.kernel.org/stable/c/51dbb5e36d59f62e34d462b801c1068248149cfe>
- patch: <https://git.kernel.org/stable/c/52ba0ab4f0a606f02a6163493378989faa1ec10a>
- patch: <https://git.kernel.org/stable/c/b26bbc0c122cad038831f226a4cb4de702225e16>
- patch: <https://git.kernel.org/stable/c/82462324bf35b6b553400af1c1aa265069cee28f>
- patch: <https://git.kernel.org/stable/c/9cdd3128874f5fe759e2c4e1360ab7fb96a8d1df>

## 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-2022-49276>

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