CVE-2021-47636

ubifs: Fix read out-of-bounds in ubifs_wbuf_write_nolock()

HIGH
7.1
CVSS Score
Published: February 26, 2025 at 01:54 AM UTC
Updated: August 5, 2026 at 09:24 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.1
Exploit prediction
EPSS 0.3%
SSVC
No known exploit

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

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

2.6.27 ≤ v < 4.19.2382.6.27 ≤ v < 5.10.1102.6.27 ≤ v < 5.15.332.6.27 ≤ v < 5.16.192.6.27 ≤ v < 5.17.22.6.27 ≤ v < 5.182.6.27 ≤ v < 5.4.1894.20 ≤ v < 5.4.1895.11 ≤ v < 5.15.335.16 ≤ v < 5.16.195.17 ≤ v < 5.17.25.5 ≤ v < 5.10.1101e51764a3c2ac05a23a22b2a95ddee4d9bffb16d2.6.27
Vendor states this is fixed in 07a209fadee7b53b46858538e1177597273862e4 (fixed)
Vendor states this is fixed in 3b7fb89135a20587d57f8877c02e25003e9edbdf (fixed)
Vendor states this is fixed in 4f2262a334641e05f645364d5ade1f565c85f20b (fixed)
Vendor states this is fixed in 5343575aa11c5d7044107d59d43f84aec01312b0 (fixed)
Vendor states this is fixed in a7054aaf1909cf40489c0ec1b728fdcf79c751a6 (fixed)
Vendor states this is fixed in b80ccbec0e4804436c382d7dd60e943c386ed83a (fixed)
Vendor states this is fixed in e09fa5318d51f522e1af4fbaf8f74999355980c8 (fixed)
Vendor states this is fixed in 2.6.27 (unaffected)
Vendor states this is fixed in 4.19.238 (unaffected)
Vendor states this is fixed in 5.10.110 (unaffected)
Vendor states this is fixed in 5.15.33 (unaffected)
Vendor states this is fixed in 5.16.19 (unaffected)
Vendor states this is fixed in 5.17.2 (unaffected)
Vendor states this is fixed in 5.18 (unaffected)
Vendor states this is fixed in 5.4.189 (unaffected)

References (7)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/07a209fadee7b53b46858538e1177597273862e4
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/3b7fb89135a20587d57f8877c02e25003e9edbdf
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/4f2262a334641e05f645364d5ade1f565c85f20b
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/5343575aa11c5d7044107d59d43f84aec01312b0
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/a7054aaf1909cf40489c0ec1b728fdcf79c751a6
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/b80ccbec0e4804436c382d7dd60e943c386ed83a
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/e09fa5318d51f522e1af4fbaf8f74999355980c8

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

7.1HIGHLinux
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-125

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card