CVE-2021-47256

mm/memory-failure: make sure wait for page writeback in memory_failure

MEDIUM
5.5
CVSS Score
Published: May 21, 2024 at 02:19 PM UTC
Updated: June 17, 2026 at 04:17 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
MEDIUM5.5
Exploit prediction
EPSS 0.2%
SSVC
No known exploit

Description

In the Linux kernel, the following vulnerability has been resolved: mm/memory-failure: make sure wait for page writeback in memory_failure Our syzkaller trigger the "BUG_ON(!list_empty(&inode->i_wb_list))" in clear_inode: kernel BUG at fs/inode.c:519! Internal error: Oops - BUG: 0 [#1] SMP Modules linked in: Process syz-executor.0 (pid: 249, stack limit = 0x00000000a12409d7) CPU: 1 PID: 249 Comm: syz-executor.0 Not tainted 4.19.95 Hardware name: linux,dummy-virt (DT) pstate: 80000005 (Nzcv daif -PAN -UAO) pc : clear_inode+0x280/0x2a8 lr : clear_inode+0x280/0x2a8 Call trace: clear_inode+0x280/0x2a8 ext4_clear_inode+0x38/0xe8 ext4_free_inode+0x130/0xc68 ext4_evict_inode+0xb20/0xcb8 evict+0x1a8/0x3c0 iput+0x344/0x460 do_unlinkat+0x260/0x410 __arm64_sys_unlinkat+0x6c/0xc0 el0_svc_common+0xdc/0x3b0 el0_svc_handler+0xf8/0x160 el0_svc+0x10/0x218 Kernel panic - not syncing: Fatal exception A crash dump of this problem show that someone called __munlock_pagevec to clear page LRU without lock_page: do_mmap -> mmap_region -> do_munmap -> munlock_vma_pages_range -> __munlock_pagevec. As a result memory_failure will call identify_page_state without wait_on_page_writeback. And after truncate_error_page clear the mapping of this page. end_page_writeback won't call sb_clear_inode_writeback to clear inode->i_wb_list. That will trigger BUG_ON in clear_inode! Fix it by checking PageWriteback too to help determine should we skip wait_on_page_writeback.

Affected

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

3.16 ≤ v < 4.14.2383.16 ≤ v < 4.19.1963.16 ≤ v < 5.10.463.16 ≤ v < 5.12.133.16 ≤ v < 5.133.16 ≤ v < 5.4.1284.15 ≤ v < 4.19.1964.20 ≤ v < 5.4.1285.11 ≤ v < 5.12.135.5 ≤ v < 5.10.460bc1f8b0682caa39f45ce1e0228ebf43acb461115.13 rc15.13 rc25.13 rc35.13 rc45.13 rc55.13 rc6
Vendor states this is fixed in 28788dc5c70597395b6b451dae4549bbaa8e2c56 (fixed)
Vendor states this is fixed in 566345aaabac853aa866f53a219c4b02a6beb527 (fixed)
Vendor states this is fixed in 6d210d547adc2218ef8b5bcf23518c5f2f1fd872 (fixed)
Vendor states this is fixed in 9e379da727a7a031be9b877cde7b9c34a0fb8306 (fixed)
Vendor states this is fixed in d05267fd27a5c4f54e06daefa3035995d765ca0c (fixed)
Vendor states this is fixed in e8675d291ac007e1c636870db880f837a9ea112a (fixed)
Vendor states this is fixed in 3.16 (unaffected)
Vendor states this is fixed in 4.14.238 (unaffected)
Vendor states this is fixed in 4.19.196 (unaffected)
Vendor states this is fixed in 5.10.46 (unaffected)
Vendor states this is fixed in 5.12.13 (unaffected)
Vendor states this is fixed in 5.13 (unaffected)
Vendor states this is fixed in 5.4.128 (unaffected)

References (6)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/28788dc5c70597395b6b451dae4549bbaa8e2c56
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/566345aaabac853aa866f53a219c4b02a6beb527
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/6d210d547adc2218ef8b5bcf23518c5f2f1fd872
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/9e379da727a7a031be9b877cde7b9c34a0fb8306
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/d05267fd27a5c4f54e06daefa3035995d765ca0c
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/e8675d291ac007e1c636870db880f837a9ea112a

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

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

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
NVD-CWE-noinfo

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