# CVE-2021-47636: ubifs: Fix read out-of-bounds in ubifs\_wbuf\_write\_nolock()

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

- **Severity:** HIGH 7.1
- **CVSS:** 7.1 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; 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-125
- **Published:** 2025-02-26T01:54:10.206Z
- **Modified:** 2026-08-05T08:48:42.752Z

## Who should check

- Anyone running Linux \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< 5343575aa11c5d7044107d59d43f84aec01312b0; \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< b80ccbec0e4804436c382d7dd60e943c386ed83a; \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< 07a209fadee7b53b46858538e1177597273862e4; \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< a7054aaf1909cf40489c0ec1b728fdcf79c751a6; \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< e09fa5318d51f522e1af4fbaf8f74999355980c8; \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< 3b7fb89135a20587d57f8877c02e25003e9edbdf; \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< 4f2262a334641e05f645364d5ade1f565c85f20b
- Anyone running Linux 2.6.27

## Description

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

ubifs: Fix read out-of-bounds in ubifs\_wbuf\_write\_nolock()

Function ubifs\_wbuf\_write\_nolock() may access buf out of bounds in
following process:

ubifs\_wbuf\_write\_nolock():
  aligned\_len = ALIGN(len, 8);   // Assume len = 4089, aligned\_len = 4096
  if (aligned\_len \<= wbuf-\>avail) ... // Not satisfy
  if (wbuf-\>used) {
    ubifs\_leb\_write()  // Fill some data in avail wbuf
    len -= wbuf-\>avail;   // len is still not 8-bytes aligned
    aligned\_len -= wbuf-\>avail;
  }
  n = aligned\_len \>\> c-\>max\_write\_shift;
  if (n) {
    n \<\<= c-\>max\_write\_shift;
    err = ubifs\_leb\_write(c, wbuf-\>lnum, buf + written,
                          wbuf-\>offs, n);
    // n \> len, read out of bounds less than 8(n-len) bytes
  }

, which can be catched by KASAN:
  =========================================================
  BUG: KASAN: slab-out-of-bounds in ecc\_sw\_hamming\_calculate+0x1dc/0x7d0
  Read of size 4 at addr ffff888105594ff8 by task kworker/u8:4/128
  Workqueue: writeback wb\_workfn (flush-ubifs\_0\_0)
  Call Trace:
    kasan\_report.cold+0x81/0x165
    nand\_write\_page\_swecc+0xa9/0x160
    ubifs\_leb\_write+0xf2/0x1b0 \[ubifs\]
    ubifs\_wbuf\_write\_nolock+0x421/0x12c0 \[ubifs\]
    write\_head+0xdc/0x1c0 \[ubifs\]
    ubifs\_jnl\_write\_inode+0x627/0x960 \[ubifs\]
    wb\_workfn+0x8af/0xb80

Function ubifs\_wbuf\_write\_nolock() accepts that parameter 'len' is not 8
bytes aligned, the 'len' represents the true length of buf (which is
allocated in 'ubifs\_jnl\_xxx', eg. ubifs\_jnl\_write\_inode), so
ubifs\_wbuf\_write\_nolock() must handle the length read from 'buf' carefully
to write leb safely.

Fetch a reproducer in \[Link\].

## Affected and fixed versions

- Linux: \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< 5343575aa11c5d7044107d59d43f84aec01312b0; \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< b80ccbec0e4804436c382d7dd60e943c386ed83a; \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< 07a209fadee7b53b46858538e1177597273862e4; \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< a7054aaf1909cf40489c0ec1b728fdcf79c751a6; \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< e09fa5318d51f522e1af4fbaf8f74999355980c8; \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< 3b7fb89135a20587d57f8877c02e25003e9edbdf; \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< 4f2262a334641e05f645364d5ade1f565c85f20b (cvelist)
- Linux: 2.6.27 (cvelist)

## Mitigation

- Upgrade Linux to 4f2262a334641e05f645364d5ade1f565c85f20b or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2021-47636.md
Affected: Linux >= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, < 5343575aa11c5d7044107d59d43f84aec01312b0; >= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, < b80ccbec0e4804436c382d7dd60e943c386ed83a; >= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, < 07a209fadee7b53b46858538e1177597273862e4; >= 1e51764a3c2ac05a23a22b2…
Fixed in: Linux 5343575aa11c5d7044107d59d43f84aec01312b0, Linux 07a209fadee7b53b46858538e1177597273862e4, Linux 3b7fb89135a20587d57f8877c02e25003e9edbdf, Linux 4f2262a334641e05f645364d5ade1f565c85f20b

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-2021-47636 being exploited?

There is no confirmed exploitation: CVE-2021-47636 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-2021-47636?

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

### Which versions are affected by CVE-2021-47636?

Linux \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< 5343575aa11c5d7044107d59d43f84aec01312b0; \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< b80ccbec0e4804436c382d7dd60e943c386ed83a; \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< 07a209fadee7b53b46858538e1177597273862e4; \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< a7054aaf1909cf40489c0ec1b728fdcf79c751a6; \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< e09fa5318d51f522e1af4fbaf8f74999355980c8; \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< 3b7fb89135a20587d57f8877c02e25003e9edbdf; \>= 1e51764a3c2ac05a23a22b2a95ddee4d9bffb16d, \< 4f2262a334641e05f645364d5ade1f565c85f20b; Linux 2.6.27.

### Is there a fix for CVE-2021-47636?

Yes. Fixed in Linux 5343575aa11c5d7044107d59d43f84aec01312b0, Linux 07a209fadee7b53b46858538e1177597273862e4, Linux 3b7fb89135a20587d57f8877c02e25003e9edbdf, Linux 4f2262a334641e05f645364d5ade1f565c85f20b. Upgrade Linux to 4f2262a334641e05f645364d5ade1f565c85f20b or later.

### How do I check if I'm affected by CVE-2021-47636?

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/5343575aa11c5d7044107d59d43f84aec01312b0>
- patch: <https://git.kernel.org/stable/c/b80ccbec0e4804436c382d7dd60e943c386ed83a>
- patch: <https://git.kernel.org/stable/c/07a209fadee7b53b46858538e1177597273862e4>
- patch: <https://git.kernel.org/stable/c/a7054aaf1909cf40489c0ec1b728fdcf79c751a6>
- patch: <https://git.kernel.org/stable/c/e09fa5318d51f522e1af4fbaf8f74999355980c8>
- patch: <https://git.kernel.org/stable/c/3b7fb89135a20587d57f8877c02e25003e9edbdf>
- patch: <https://git.kernel.org/stable/c/4f2262a334641e05f645364d5ade1f565c85f20b>

## 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-2021-47636>

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