CVE-2026-139614: mtd: block: prevent reclaim I/O during request processing
In the Linux kernel, the following vulnerability has been resolved:
mtd: block: prevent reclaim I/O during request processing
The blktrans request callbacks run under dev->lock and may allocate memory with GFPKERNEL. For example, mtdblockwritesect() uses vmalloc() to allocate its eraseblock cache. Direct reclaim can then recurse into block I/O and deadlock on resources held by the request being processed. syzbot reports a circular locking dependency involving the device mutex and fsreclaim.
Commit d5ba1c8ffd0b ("mtd: don't use PFMEMALLOC") removed PFMEMALLOC from the MTD request thread. That flag had prevented direct reclaim, so its removal made allocations during request processing eligible for reclaim without excluding I/O.
Wrap request processing in mtdqueuerq() in a NOIO scope. This covers both the request and background callbacks, including allocations made by lower MTD drivers, and prevents reclaim from initiating filesystem or block I/O.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In the Linux kernel, wrap request processing in mtd_queue_rq() in a NOIO scope to prevent reclaim from initiating filesystem or block I/O.
Event History
Frequently Asked Questions
What conditions can trigger the deadlock?
The issue can occur when blktrans request or background callbacks allocate memory with GFP_KERNEL while running under dev->lock. Direct memory reclaim may then recurse into filesystem or block I/O and deadlock on resources held by the request currently being processed.
Which configurations are exposed?
Systems using the MTD block translation layer are relevant, particularly paths that perform memory allocation during request processing. The description specifically identifies mtdblock_writesect(), which uses vmalloc() for its eraseblock cache.
What changed to make this possible?
Removal of PF_MEMALLOC from the MTD request thread made allocations during request processing eligible for direct reclaim. Previously, that flag prevented direct reclaim.
How can the issue be identified in a running system?
A symptom is a circular locking dependency involving the device mutex and fs_reclaim, as reported by syzbot. The described failure mode is a deadlock during MTD block request processing under memory-reclaim pressure.
What mitigation does the fix apply?
The fix wraps request processing in mtd_queue_rq() in a NOIO scope. This prevents reclaim initiated by allocations in request and background callbacks, including lower MTD driver allocations, from starting filesystem or block I/O.