CVE-2026-143014: dm-crypt: defer async write submission to write thread
In the Linux kernel, the following vulnerability has been resolved:
dm-crypt: defer async write submission to write thread
With nowriteworkqueue, kcryptdcryptwriteiosubmit() submits the bio directly, even when called from kcryptdasyncdone(). An async cipher may run this callback in softirq or with BH disabled, where submitbionoacct() must not be called because it can sleep.
Submit inline only when async is false. Async completions are sent to the write thread, as is already done for submitfromcryptcpus. Use the async flag rather than ininterrupt(), since callback context depends on the cipher driver. Sync ciphers still submit inline.
Tested with cryptd in QEMU (x8664 and arm64) with CONFIGDEBUGATOMICSLEEP, and on a P2020 running 6.18.55 without it.
In QEMU:
- 4k writes logging "sleeping function called from invalid context": 100/100 unpatched, 0/155 patched. - nrrequests=4 on a loop device: 0/6 unpatched runs completed, 4/4 patched runs completed.
On the P2020, a warning in blkmqrunhwqueue() appeared in the 6th unpatched run and did not appear in 30 patched runs.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In dm-crypt, defer asynchronous write submission to the write thread; submit inline only when async is false, including when handling completions from kcryptd_async_done().
Event History
Frequently Asked Questions
Which dm-crypt deployments are exposed to this issue?
The affected path requires dm-crypt to use no_write_workqueue and an asynchronous cipher. Synchronous ciphers still submit writes inline and are not described as using the unsafe asynchronous completion path.
What can happen when the affected path is exercised?
Async cipher completion can invoke write submission in softirq context or with bottom halves disabled, even though submit_bio_noacct() may sleep. Reported symptoms include “sleeping function called from invalid context” messages, a warning in blk_mq_run_hw_queue(), and writes that fail to complete under constrained request settings.
What can be done before applying the fix?
Avoid using the no_write_workqueue configuration with asynchronous cipher operation, so asynchronous write completions are not directly submitted through the affected path. The fix instead routes async completions to the write thread.
How can administrators look for signs of impact?
Review kernel logs for “sleeping function called from invalid context” during dm-crypt write activity, or warnings from blk_mq_run_hw_queue(). Write stalls or failed completion under load, including on loop devices with low nr_requests settings, are also reported indicators.