CVE-2021-47256
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
21/05/2024
Last modified:
30/04/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
mm/memory-failure: make sure wait for page writeback in memory_failure<br />
<br />
Our syzkaller trigger the "BUG_ON(!list_empty(&inode->i_wb_list))" in<br />
clear_inode:<br />
<br />
kernel BUG at fs/inode.c:519!<br />
Internal error: Oops - BUG: 0 [#1] SMP<br />
Modules linked in:<br />
Process syz-executor.0 (pid: 249, stack limit = 0x00000000a12409d7)<br />
CPU: 1 PID: 249 Comm: syz-executor.0 Not tainted 4.19.95<br />
Hardware name: linux,dummy-virt (DT)<br />
pstate: 80000005 (Nzcv daif -PAN -UAO)<br />
pc : clear_inode+0x280/0x2a8<br />
lr : clear_inode+0x280/0x2a8<br />
Call trace:<br />
clear_inode+0x280/0x2a8<br />
ext4_clear_inode+0x38/0xe8<br />
ext4_free_inode+0x130/0xc68<br />
ext4_evict_inode+0xb20/0xcb8<br />
evict+0x1a8/0x3c0<br />
iput+0x344/0x460<br />
do_unlinkat+0x260/0x410<br />
__arm64_sys_unlinkat+0x6c/0xc0<br />
el0_svc_common+0xdc/0x3b0<br />
el0_svc_handler+0xf8/0x160<br />
el0_svc+0x10/0x218<br />
Kernel panic - not syncing: Fatal exception<br />
<br />
A crash dump of this problem show that someone called __munlock_pagevec<br />
to clear page LRU without lock_page: do_mmap -> mmap_region -> do_munmap<br />
-> munlock_vma_pages_range -> __munlock_pagevec.<br />
<br />
As a result memory_failure will call identify_page_state without<br />
wait_on_page_writeback. And after truncate_error_page clear the mapping<br />
of this page. end_page_writeback won&#39;t call sb_clear_inode_writeback to<br />
clear inode->i_wb_list. That will trigger BUG_ON in clear_inode!<br />
<br />
Fix it by checking PageWriteback too to help determine should we skip<br />
wait_on_page_writeback.
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 3.16 (including) | 4.14.238 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 4.15 (including) | 4.19.196 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 4.20 (including) | 5.4.128 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.5 (including) | 5.10.46 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.11 (including) | 5.12.13 (excluding) |
| cpe:2.3:o:linux:linux_kernel:5.13:rc1:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.13:rc2:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.13:rc3:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.13:rc4:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.13:rc5:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.13:rc6:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- 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
- https://git.kernel.org/stable/c/e8675d291ac007e1c636870db880f837a9ea112a
- 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
- https://git.kernel.org/stable/c/e8675d291ac007e1c636870db880f837a9ea112a



