Acknowledged
Created: Jun 18, 2025
Updated: Sep 4, 2026
Resolved Date: Jun 19, 2025
Found In Version: 10.25.33.1
Severity: Standard
Applicable for: Wind River Linux LTS 25
Component/s: Kernel
In the Linux kernel, the following vulnerability has been resolved:EOL][EOL]btrfs: ensure pages are unlocked on cow_file_range() failure[EOL][EOL]There is a hung_task report on zoned btrfs like below.[EOL][EOL]https://github.com/naota/linux/issues/59[EOL][EOL] [726.328648] INFO: task rocksdb:high0:11085 blocked for more than 241 seconds.[EOL] [726.329839] Not tainted 5.16.0-rc1+ #1[EOL] [726.330484] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.[EOL] [726.331603] task:rocksdb:high0 state:D stack: 0 pid:11085 ppid: 11082 flags:0x00000000[EOL] [726.331608] Call Trace:[EOL] [726.331611] <TASK>[EOL] [726.331614] __schedule+0x2e5/0x9d0[EOL] [726.331622] schedule+0x58/0xd0[EOL] [726.331626] io_schedule+0x3f/0x70[EOL] [726.331629] __folio_lock+0x125/0x200[EOL] [726.331634] ? find_get_entries+0x1bc/0x240[EOL] [726.331638] ? filemap_invalidate_unlock_two+0x40/0x40[EOL] [726.331642] truncate_inode_pages_range+0x5b2/0x770[EOL] [726.331649] truncate_inode_pages_final+0x44/0x50[EOL] [726.331653] btrfs_evict_inode+0x67/0x480[EOL] [726.331658] evict+0xd0/0x180[EOL] [726.331661] iput+0x13f/0x200[EOL] [726.331664] do_unlinkat+0x1c0/0x2b0[EOL] [726.331668] __x64_sys_unlink+0x23/0x30[EOL] [726.331670] do_syscall_64+0x3b/0xc0[EOL] [726.331674] entry_SYSCALL_64_after_hwframe+0x44/0xae[EOL] [726.331677] RIP: 0033:0x7fb9490a171b[EOL] [726.331681] RSP: 002b:00007fb943ffac68 EFLAGS: 00000246 ORIG_RAX: 0000000000000057[EOL] [726.331684] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fb9490a171b[EOL] [726.331686] RDX: 00007fb943ffb040 RSI: 000055a6bbe6ec20 RDI: 00007fb94400d300[EOL] [726.331687] RBP: 00007fb943ffad00 R08: 0000000000000000 R09: 0000000000000000[EOL] [726.331688] R10: 0000000000000031 R11: 0000000000000246 R12: 00007fb943ffb000[EOL] [726.331690] R13: 00007fb943ffb040 R14: 0000000000000000 R15: 00007fb943ffd260[EOL] [726.331693] </TASK>[EOL][EOL]While we debug the issue, we found running fstests generic/551 on 5GB[EOL]non-zoned null_blk device in the emulated zoned mode also had a[EOL]similar hung issue.[EOL][EOL]Also, we can reproduce the same symptom with an error injected[EOL]cow_file_range() setup.[EOL][EOL]The hang occurs when cow_file_range() fails in the middle of[EOL]allocation. cow_file_range() called from do_allocation_zoned() can[EOL]split the give region ([start, end]) for allocation depending on[EOL]current block group usages. When btrfs can allocate bytes for one part[EOL]of the split regions but fails for the other region (e.g. because of[EOL]-ENOSPC), we return the error leaving the pages in the succeeded regions[EOL]locked. Technically, this occurs only when @unlock == 0. Otherwise, we[EOL]unlock the pages in an allocated region after creating an ordered[EOL]extent.[EOL][EOL]Considering the callers of cow_file_range(unlock=0) won't write out[EOL]the pages, we can unlock the pages on error exit from[EOL]cow_file_range(). So, we can ensure all the pages except @locked_page[EOL]are unlocked on error case.[EOL][EOL]In summary, cow_file_range now behaves like this:[EOL][EOL]- page_started == 1 (return value)[EOL] - All the pages are unlocked. IO is started.[EOL]- unlock == 1[EOL] - All the pages except @locked_page are unlocked in any case[EOL]- unlock == 0[EOL] - On success, all the pages are locked for writing out them[EOL] - On failure, all the pages except @locked_page are unlocked
CREATE(Triage):(User=lchen-cn) [CVE-2022-50089 (https://nvd.nist.gov/vuln/detail/CVE-2022-50089)