CVE-2021-47256·Kernel vulnerability
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.
- Severity
- medium
- Software
- Kernel
- Fixed in
- 5.12.13
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at <0.1% — higher than 1% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Affected versions
From: 5.11
Until: 5.12.13
Fixed in: 5.12.13
How to fix this CVE
Update your Linux kernel to version 5.12.13 or later to resolve this memory management vulnerability. The fix ensures that page writeback completion is properly waited for during memory failure handling, preventing kernel panic conditions. Systems running kernel versions 5.11 through 5.12.12 should prioritize this patch application.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check kernel version with `uname -r` and compare against 5.12.13 threshold
- Step 2: Verify if the system uses ext4 or similar filesystems prone to writeback races: `mount | grep -E 'ext4|btrfs|xfs'`
- Step 3: Search kernel logs for BUG_ON panic patterns: `dmesg | grep -i 'BUG_ON\|inode.*i_wb_list'`
- Step 4: Confirm kernel update applied successfully: `uname -r` should show version 5.12.13 or newer after reboot
FAQ
What is CVE-2021-47256?
This vulnerability exists in the Linux kernel's memory failure handler, which fails to properly synchronize page writeback operations during inode cleanup. This can trigger a kernel panic when memory failure code runs concurrently with page cache operations without waiting for pending writes to complete.
Is CVE-2021-47256 being actively exploited?
No, this CVE is not listed on the CISA KEV catalog and no public exploits are currently available. However, it can be triggered through specific race conditions involving munlock and memory failure paths.
What versions of Kernel are affected by CVE-2021-47256?
Linux kernel versions 5.11 through 5.12.12 are vulnerable. The patch was integrated starting with kernel 5.12.13.
How do I check if my server is vulnerable to CVE-2021-47256?
Run `uname -r` to display your kernel version. If the output shows 5.11.x or 5.12.0 through 5.12.12, your system is vulnerable and requires patching.
Does Defensia detect CVE-2021-47256?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel is installed on a monitored server, CVE-2021-47256 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/28788dc5c70597395b6b451dae4549bbaa8e2c56
- https://git.kernel.org/stable/c/566345aaabac853aa866f53a219c4b02a6beb527
- https://git.kernel.org/stable/c/6d210d547adc2218ef8b5bcf23518c5f2f1fd872
- https://git.kernel.org/stable/c/9e379da727a7a031be9b877cde7b9c34a0fb8306
- https://git.kernel.org/stable/c/d05267fd27a5c4f54e06daefa3035995d765ca0c
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2021-47256. Free for 1 server.
Get started free